Tag: mysql

How to install pdo driver in php docker image?

I am using as a base the php docker container with the tag: php:5.6-apache I linked it with a basic mysql:5.6 image which I can reach at the host mysql. I created a DB, and filled a table with basic values. Yet trying to access my app, I get: Fatal error: Uncaught exception ‘PDOException’ with […]

How to create ssh tunnel to dockerfile/mysql container

I am looking for the right syntax to use to create an SSH tunnel (on a non-standard port, eg 3309) that I can use from Mac OS X Yosemite terminal, which will enable me to use Sequel Pro to connect to the mysql container running inside boot2docker. For example, I tried this, ssh -L3309:localhost:3306 docker@$(boot2docker […]

How to “undeclare” volumes in docker image?

I am writing a Dockerfile for setting up an image for testing a web application. I am basing it on the tutum/lamp image (https://github.com/tutumcloud/tutum-docker-lamp/blob/master/Dockerfile) because that seems to be a good base to start from. As part of my dockerfile, I want to create a mysql database and set up some stuff in it. However, […]

Mysql installation on docker container

I am trying to run mysql into modified ubuntu image which includs installation of Node.js and basic mysql installation using below docker file # Memcached # use the ubuntu base image provided by dotCloud FROM ubuntu/mysqlbase MAINTAINER Hitesh # make sure the package repository is up to dat//e #RUN echo “deb http://archive.ubuntu.com/ubuntu precise main universe” […]

MySQL image ignores volume configuration of docker-compose.yml

Using the official MySQL Docker image, I don’t understand how to mount the data directory to a specifc point on the host. The Dockerfile of the image sets VOLUME /var/lib/mysql so database data should be stored “somewhere” on the host. I want to be more specific in my docker-compose file, so I tried the following: […]

Docker: MySQL refuses host IP unless I restart it manually

Here is my Dockerfile: FROM debian:jessie-backports RUN apt-get update –yes && apt-get upgrade –yes RUN DEBIAN_FRONTEND=noninteractive apt-get install -y –no-install-recommends \ git \ curl \ build-essential\ libssl-dev\ ca-certificates\ mysql-server\ redis-server\ elasticsearch USER root ENV HOME /root # MYSQL SETUP RUN sed -i -e”s/^bind-address\s*=\s* =” /etc/mysql/my.cnf RUN sed -i -e”s/^#max_connections\s*=\s*100/max_connections = 200/” /etc/mysql/my.cnf RUN echo […]

How to connect to MySQL running on Docker from the host machine

I have already googled on this subject and found few threads. Based on these threads I have followed the following steps. But I am facing a problem. Basically, I want to create a docker image for mysql and then connect to it from my host machine (Mac OS X). Based on this post , I […]

How to enable pdo_mysql in the php docker image

I have a basic Dockerfile with the following in: FROM php:7.1-apache RUN apt-get update && docker-php-ext-install pdo_mysql COPY . /var/www EXPOSE 80 I have a docker-compose.yml file version: “3” services: app: build: . ports: – “80:80” volumes: – .:/var/www depends_on: – mysql mysql: image: mysql:8 ports: – “3306:3306” environment: MYSQL_DATABASE: “app” MYSQL_USER: “app” MYSQL_PASSWORD: “app” […]

Connect to mysql in a docker container from the host

(It’s probably a dumb question due to my limited knowledge with Docker or mysql administration, but since I spent a whole evening on this issue, I dare to ask it.) In a nutshell I want to run mysql in a docker container and connect to it from my host. So far, the best I achieve […]

Running docker-compose with mysql and own docker container

I am trying to start my own container and link it with the official mysql container. I am using docker-compose to start both containers and link them together. My own container is supposed to be a regular LAMP-stack which runs a simple PHP application. When I run docker-compose up, they both build properly, but when […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.