我正在使用这个Dockerfile。
我的Dockerfile有问题还是docker build命令有问题?
ARG IMAGE_ONE
FROM ${IMAGE_ONE}
RUN cat /etc/debian_version
ARG IMAGE_TWO
FROM ${IMAGE_TWO}
RUN cat /etc/debian_version
但是它失败了,因为它没有使用第二个变量IMAGE_TWO:
$ docker build --no-cache --build-arg IMAGE_ONE=debian:7 --build-arg IMAGE_TWO=debian:8 .
Sending build context to Docker daemon 2.048kB
Step 1/6 : ARG IMAGE_ONE
Step 2/6 : FROM ${IMAGE_ONE}
---> 90c038768099
Step 3/6 : RUN cat /etc/debian_version
---> Running in f842d9cf4f17
7.11
Removing intermediate container f842d9cf4f17
---> 0f7f7afdd8a6
Step 4/6 : ARG IMAGE_TWO
---> Running in ed3d36f2f9cb
Removing intermediate container ed3d36f2f9cb
---> ae4ae3cabc02
Step 5/6 : FROM ${IMAGE_TWO}
--->
Step 6/6 : RUN cat /etc/debian_version
---> Running in 6f1c165e2765
OCI runtime create failed: container_linux.go:296:
starting container process caused "exec: \"/bin/sh\":
stat /bin/sh: no such file or directory": unknown
Docker版本:
$ docker --version
Docker version 17.12.0-ce, build c97c6d6
我的Dockerfile有问题还是docker build命令有问题?