【发布时间】:2017-05-10 12:45:34
【问题描述】:
由于某种原因,我无法完成docker build,除非进程停止并且没有提供错误。我用谷歌搜索了一下,似乎没有人有同样的问题。
我正在使用的 Dockerfile 配置的第一个(也是最重要的)部分:
FROM java:8-jre
ENV DEBIAN_FRONTEND noninteractive
# Install needed packages
RUN apt-get update
RUN apt-get install -y \
cron
我用来执行构建的命令(build.cmd):
@ECHO OFF
docker --debug --log-level debug build . ^
--build-arg http_proxy=%http_proxy% ^
--build-arg https_proxy=%https_proxy% ^
--build-arg no_proxy=%no_proxy% ^
--tag "bravura/jfrog-mission-control:latest" ^
%*
运行结果:
Sending build context to Docker daemon 133.9MB
Step 1/7 : FROM java:8-jre
---> e44d62cf8862
Step 2/7 : ENV DEBIAN_FRONTEND noninteractive
---> Using cache
---> f30e6ab20920
Step 3/7 : RUN apt-get update
---> Running in 677bd445e48c
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [508 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:4 http://deb.debian.org jessie-backports InRelease [166 kB]
Get:5 http://deb.debian.org jessie Release.gpg [2373 B]
Get:6 http://deb.debian.org jessie Release [148 kB]
Get:7 http://deb.debian.org jessie-updates/main amd64 Packages [17.6 kB]
Get:8 http://deb.debian.org jessie-backports/main amd64 Packages [1150 kB]
Get:9 http://deb.debian.org jessie/main amd64 Packages [9065 kB]
Fetched 11.3 MB in 6s (1829 kB/s)
Reading package lists...
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
这是最重要的:在运行 docker run -it --rm java:8-jre /bin/bash 所产生的 shell 中运行相同的命令集非常好。
另一个有趣的地方:将两个命令连接在一起(使用 &&)将退出推迟到两个执行结束。事实上,实际上并没有产生任何错误,所以在末尾附加额外的命令就可以了(例如apt-get update && apt-get install -y cron && echo "Done!")
任何帮助甚至确定可以报告问题的位置都将不胜感激。
更新:与这些事情的方式一样,我想在发布此内容后立即查看服务日志。发现以下花絮可能会为我指明正确的方向:
[13:50:31.818][ApiProxy ][Info ] error copying response body from Docker: unexpected EOF
[13:50:31.818][ApiProxy ][Info ] error closing response body from Docker: unexpected EOF
但是,仍然不知道这意味着什么。可能只是另一种症状而不是原因。
更新:刚刚再次运行构建以仔细检查提交的响应,并且没有更改我的 Dockerfile,现在一切正常。一种可能的选择是该问题已在上次更新(我今天安装)中静默修复。我真的没有时间恢复和重新测试,所以直到我再次遇到问题,或者其他人得到同样的东西。
【问题讨论】:
标签: docker dockerfile apt-get