我正在尝试使用以下Docker文件将MySQL运行到修改过的Ubuntu镜像中,其中包括安装Node.js和基本的MySQL安装。
# 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
使用以下命令运行此服务器
sudo docker run -p 3306:13306 mysql/dockerfiletest
遇到以下错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
有人能否建议一下这里需要做什么更改。我想使用这个容器与另一个容器链接,该容器实际上正在运行我的node.js应用程序。