问题描述
我发现我的Ubuntu 14.04主机和Docker Hub自动化版本之间建立码头码头图像有一个奇怪的区别。这是我的Dockerfile:
FROM buildpack-deps:wheezy-scm
RUN echo $ HOME
这是我机器中的输出:
--- > 2afbec25f6f6
步骤1:RUN echo $ HOME
--->运行在6074455e13c0
/
---> 0cb1b6141f93
删除中间容器6074455e13c0
成功构建0cb1b6141f93
这个来自Docker hub:
---> 2afbec25f6f6
步骤1:RUN echo $ HOME
/ root
---> 4c781d2d7d72
成功构建4c781d2d7d72
请注意不同的 HOME
目录: / root
而不是 /
。任何人都可以解释我发生了什么?
这是我的Docker版本(我已经安装了标准的 docker.io
Ubuntu软件包):
$ docker版本
客户端版本:1.0.1
客户端API版本:1.12
Go版本(客户端):go1.2.1
Git提交(客户端):990021a
服务器版本:1.0.1
服务器API版本:1.12
转到版本(服务器):go1.2.1
Git commit(server):990021a
有效地在 $ HOME
中有变化,并且更改在Docker发布后合并 v1.0
。我已经构建了您提供的Docker文件,并显示了我 $ HOME = / root
(我使用Docker v1.5.0
) 。请查看及相关提交,以获取更多详细信息。
I have found a strange difference between building docker images in my Ubuntu 14.04 host machine and the Docker Hub automated builds.
This is my Dockerfile:
FROM buildpack-deps:wheezy-scm
RUN echo $HOME
This is the output in my machine:
---> 2afbec25f6f6
Step 1 : RUN echo $HOME
---> Running in 6074455e13c0
/
---> 0cb1b6141f93
Removing intermediate container 6074455e13c0
Successfully built 0cb1b6141f93
And this one comes from Docker hub:
---> 2afbec25f6f6
Step 1 : RUN echo $HOME
/root
---> 4c781d2d7d72
Successfully built 4c781d2d7d72
Note the different HOME
directories: /root
instead of /
. Can anyone explain me what is happening?
This is my Docker version (I have installed the standarddocker.io
Ubuntu package):
$ docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a
Effectively there were a change in $HOME
, and the changes were merged after Docker release v1.0
. I have built the Dockerfile you provided and it shows me $HOME=/root
(I use Docker v1.5.0
). Check Docker Issue #2968 and related commits for additional details.
这篇关于Docker在Docker集线器中构建不同的主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!