I am trying to run mysql in a modified ubuntu image that includes installing Node.js and a 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" > /etc/apt/sources.list #RUN apt-get update #RUN apt-get install -y mysql-client #ENTRYPOINT ["wc", "-l"] #ENTRYPOINT ["echo", "running"] ENTRYPOINT mysqld_safe & sleep 10 #RUN mysql RUN echo "[mysqld]" >/etc/mysql/conf.d/docker.cnf RUN echo "bind-address = 0.0.0.0" >>/etc/mysql/conf.d/docker.cnf RUN echo "innodb_flush_method = O_DSYNC" >>/etc/mysql/conf.d/docker.cnf RUN echo "skip-name-resolve" >>/etc/mysql/conf.d/docker.cnf RUN echo "init_file = /etc/mysql/init" >>/etc/mysql/conf.d/docker.cnf RUN echo "GRANT ALL ON *.* TO root@ '%'" >/etc/mysql/init USER root EXPOSE 3306
When starting this server using the command below
sudo docker run -p 3306:13306 mysql/dockerfiletest
An error has occurred:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Can anyone suggest what needs to be changed here. I want to use this container to communicate with another container, which essentially launches my Node.js application.
source share