我想知道图像是如何在docker hub中构建的。我从github配置了一个autobuild,所以每当我推送到github时,docker hub都会构建一个新的图像。但我无法找出传递给build命令的参数。例如,我认为它是用--force-rm调用的,因为在日志中我可以看到在每个步骤之后删除了中间层。我想在我的本地系统(Docker version 18.03.1-ce, build 9ee9f40
)上重建构建过程,因为本地我的图像是构建的并且在docker hub上我得到以下错误:
Building in Docker Cloud's infrastructure...
Cloning into '.'...
KernelVersion: 4.4.0-93-generic
Arch: amd64
BuildTime: 2017-08-17T22:50:04.828747906+00:00
ApiVersion: 1.30
Version: 17.06.1-ce
MinAPIVersion: 1.12
GitCommit: 874a737
Os: linux
GoVersion: go1.8.3
Starting build of index.docker.io/jabaa/angular-cli:latest...
Step 1/6 : FROM node:9.11.1
---> d42348c94e97
Step 2/6 : RUN npm update -g npm@6.0.0
---> Running in 8a9a45336c6e
---> a5b1c2d5f34d
Removing intermediate container 8a9a45336c6e
Step 3/6 : RUN npm i -g yarn@1.5.1
---> Running in e8fe63a39537
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.5.1
added 1 package in 2.081s
---> ed28e5dc20aa
Removing intermediate container e8fe63a39537
Step 4/6 : RUN yarn global add @angular/cli@1.7.4
---> Running in 515c038e900f
[91mcontainer_linux.go:262: starting container process caused "exec: \"yarn\": executable file not found in $PATH"
[0m
Removing intermediate container 515c038e900f
oci runtime error: container_linux.go:262: starting container process caused "exec: \"yarn\": executable file not found in $PATH"
这是我本地系统上的日志:
Sending build context to Docker daemon 80.38kB
Step 1/6 : FROM node:9.11.1
---> aa3e171e4e95
Step 2/6 : RUN ["npm", "update", "-g", "npm@6.0.0"]
---> Running in 345f035cc8bf
Removing intermediate container 345f035cc8bf
---> f3afe30b0623
Step 3/6 : RUN ["npm", "i", "-g", "yarn@1.5.1"]
---> Running in bb196caa2c68
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.5.1
added 1 package in 0.647s
Removing intermediate container bb196caa2c68
---> e353fc928f6b
Step 4/6 : RUN ["yarn", "global", "add", "@angular/cli@1.7.4"]
---> Running in d586a40e6157
yarn global v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.3: The platform "linux" is incompatible with this module.
info "fsevents@1.2.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@angular/cli@1.7.4" with binaries:
- ng
Done in 26.37s.
Removing intermediate container d586a40e6157
---> 663e31095604
Step 5/6 : USER node
---> Running in 7585e5fca393
Removing intermediate container 7585e5fca393
---> c61d72cc9f00
Step 6/6 : WORKDIR /home/node
Removing intermediate container 936231ce0a8c
---> afce371c0911
Successfully built afce371c0911
这是Dockerfile:
FROM node:9.11.1
RUN ["npm", "update", "-g", "npm@6.0.0"]
RUN ["npm", "i", "-g", "yarn@1.5.1"]
RUN ["yarn", "global", "add", "@angular/cli@1.7.4"]
USER node
WORKDIR /home/node