docker - |1 在 Docker 历史中意味着什么

标签 docker

鉴于此 Dockerfile :

FROM debian:8.3
ARG TEST=123
RUN echo $TEST
|1有什么用在 Docker 历史中代表什么?
$ docker history 2feee0d8320f
IMAGE               CREATED              CREATED BY                                      SIZE                COMMENT
2feee0d8320f        About a minute ago   |1 TEST=123 /bin/sh -c echo $TEST               0 B
ac4872d0de0b        About a minute ago   /bin/sh -c #(nop)  ARG TEST=123                 0 B
f50f9524513f        9 months ago         /bin/sh -c #(nop) CMD ["/bin/bash"]             0 B
<missing>           9 months ago         /bin/sh -c #(nop) ADD file:b5391cb13172fb513d   125.1 MB

最佳答案

如图 in this issue ,这代表一个 build-arg (即用于构建图像的参数数量)

A good example is http_proxy or source versions for pulling intermediate files.
The ARG instruction lets Dockerfile authors define values that users can set at build-time using the --build-arg flag:


$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 .

This flag allows you to pass the build-time variables that are accessed like regular environment variables in the RUN instruction of the Dockerfile.



Here's an example of build args going through 1.10+:


[
  "|4 a=1 b=2 c=3 d=4 /bin/sh -c echo $a $b $c $d"
]

关于docker - |1 在 Docker 历史中意味着什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41311620/

相关文章:

python - 链接 python app docker 和 postgres docker

docker - 在哪里可以找到Docker容器中的挂载文件夹?

docker - Tensorflow/Docker对开发有用吗,还是仅用于演示/测试?

docker - 如何在 Traefik v2.3 中使用粘性 session ?

docker - Docker:物理机之间的连接-VM -Docker容器

javascript - 在 docker 容器中运行 selenium 测试

docker - 从 docker registry 获取 list 列表(fat manifest)

docker - 带有WebStorm节点远程解释器的Mac版Docker

docker - docker安装后ssh无法正常工作

azure - 如何在 Windows 版 Docker 上运行 Cosmos DB 模拟器?