相同的DockerFile提供不同的行为

相同的DockerFile提供不同的行为,docker,Docker,我正在使用取自()的以下dockerfile: 来自ubuntu 运行dpkg divert--local--rename--add/sbin/initctl 运行ln-s/bin/true/sbin/initctl 运行echo“deb precise main universe”>/etc/apt/sources.list 运行apt获取更新 运行apt获取升级-y 运行apt get-y安装mysql客户端mysql服务器 运行sed-i-e“s/^bind address\s*=\s*1

我正在使用取自()的以下dockerfile:

来自ubuntu

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

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

运行echo“deb precise main universe”>/etc/apt/sources.list

运行apt获取更新

运行apt获取升级-y

运行apt get-y安装mysql客户端mysql服务器

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

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

暴露3305

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

当我在本地机器上构建Docker版本0.8时,这不会出错

我一直在试验受信任的构建:

但是,在docker服务器上,第二个RUN命令出现错误:

[91mln:未能创建符号链接“/sbin/initctl”:文件存在

[0m

错误:生成:命令[/bin/sh-cln-s/bin/true/sbin/initctl]返回非零代码:1


我的印象是Dockerfiles应该独立于上下文工作?也许我正在使用的ubuntu版本不完全相同?

ubuntu映像的版本可能不同。非常准确地说,你可以在FROM语句中给出你想要的完整映像id,例如

# 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
...