出于某种原因,我一直未能完成docker build
而没有停止进程并且没有提供任何错误。我一直在搜索,没有人似乎有同样的问题。为什么在Dockerfile构建期间apt-get exit没有错误?
我使用的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.
下面是一个很大的问题:在shell中运行相同的一组命令,通过运行docker run -it --rm java:8-jre /bin/bash
完美无缺。另一个有趣的位:将两个命令连接在一起(使用& &)将退出推迟到两个执行的结尾。事实上,没有错误实际产生,所以追加额外的命令到最后工作就好(例如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,现在一切都运行良好。一个可能的选择是,这个问题在上次更新(我今天安装的)中悄然修复。我没有时间回复和重新测试,所以这是它,直到我再次遇到问题,或其他人得到同样的东西。
这只是导致我的编译失败,因为它直接附加我的下一个命令的那一个,与结束了'运行apt-get更新运行apt-get安装... etc' – tzrlk