相同的docker文件给予不同的行为

我正在使用从( http://txt.fliglio.com/2013/11/creating-a-mysql-docker-container/ )采取以下dockerfile:

从Ubuntu的

运行dpkg-divert –local –rename –add / sbin / initctl

运行ln -s / bin / true / sbin / initctl

RUN echo“deb http://archive.ubuntu.com/ubuntu精确主宇宙”> /etc/apt/sources.list

运行apt-get更新

运行apt-get升级-y

运行apt-get -y安装mysql-client mysql-server

RUN sed -i -e“s / ^ bind-address \ s * = \ s * 127.0.0.1 / bind-address = 0.0.0.0/”/etc/mysql/my.cnf

添加./startup.sh /opt/startup.sh

EXPOSE 3305

CMD [“/ bin / bash”,“/opt/startup.sh”]

当我在本地机器上构buildDocker 0.8版本时,这没有任何错误。

我一直在试验可信任的构build: https : //index.docker.io/u/hardingnj/sqlcontainer/

但是在docker服务器上,我收到第二个RUN命令的错误:

[91mln:无法创build符号链接`/ sbin / initctl':文件存在

[0米

错误:build:命令[/ bin / sh -c ln -s / bin / true / sbin / initctl]返回非零代码:1

我的印象是,Dockerfiles应该独立于上下文独立工作吗? 也许我拉的Ubuntu版本不一样?

这可能是Ubuntu的图像版本不同。 要非常精确,您可以在FROM语句中提供您想要的完整图像标识,例如

# This is the id of the current Ubuntu 13.10 image. # The tag could move to a different image at a later time. FROM 9f676bd305a43a931a8d98b13e5840ffbebcd908370765373315926024c7c35e RUN dpkg-divert --local --rename --add /sbin/initctl ...