为什么在Dockerfile构build过程中apt-get exit没有错误?

出于某种原因,我一直无法完成一个docker build没有进程停止,没有提供错误。 我一直在search,没有人似乎有同样的问题。

我正在使用的Dockerfileconfiguration的第一个(和显着的)部分:

 FROM java:8-jre ENV DEBIAN_FRONTEND noninteractive # Install needed packages RUN apt-get update RUN apt-get install -y \ cron 

我用来执行构build(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 

但是,仍然没有真正的想法是什么意思。 可能只是另一个症状,而不是一个原因。

更新:再次运行构build仔细检查提交的响应,并没有更改我的Dockerfile,现在一切都工作得很好。 一个可能的select是,在上次更新(我今天安装)中,这个问题已经被静静的修复了。 我没有时间回复和重新testing,直到我再次遇到这个问题,或者其他人得到同样的结果。

意外的EOF(文件结束)。 看起来你在RUN命令结束时忘记了“\”。

 RUN apt-get update && apt-get install -y cron && echo "Done!" \ 

要么

 RUN apt-get update && \ apt-get install -y cron && \ echo "Done!" \ 

@Tzrlk是你在公司代理人后面工作的吗? 尝试直接在你的terminal上运行这个命令,然后使用docker build命令并查看。

 export http_proxy=http://your proxy here:port here export https_proxy=http://your proxy here:port here