我有一个原始 docker 镜像,我想运行一个容器并修改它,然后提交一个新镜像。 我检查了原始的 docker 镜像,它有一个 conf
"Config": {
...
"Cmd": [
"/bin/bash",
"-ic",
"./run.sh"
],
...,
"Entrypoint": null,
...
},
我想为新提交的图像保留相同的 Cmd 和入口点。 但无论我使用 --change 与否,我都无法为新图像保留 "Entrypoint": null 。有什么办法吗? 另外,我也用docker-py,也有同样的问题。
最佳答案
考虑issue 23498和 PR 23498 ,尝试使用:
--change '[""]'
# or
--change []
If the array consists of exactly one empty string (
[""]
) then the entry point is reset to system default (i.e., the entry point used by docker when there is noENTRYPOINT
instruction in the Dockerfile).
但是,如果系统默认是 /bin/sh -c
... 那对你不起作用。
参见“Default Docker entrypoint”。
关于docker - 如何提交具有空入口点的 docker 容器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51334952/