docker - 如何提交具有空入口点的 docker 容器?

标签 docker containers

我有一个原始 docker 镜像,我想运行一个容器并修改它,然后提交一个新镜像。 我检查了原始的 docker 镜像,它有一个 conf

"Config": {
        ...
        "Cmd": [
            "/bin/bash",
            "-ic",
            "./run.sh"
        ],

         ...,
        "Entrypoint": null,
        ...
    },

我想为新提交的图像保留相同的 Cmd 和入口点。 但无论我使用 --change 与否,我都无法为新图像保留 "Entrypoint": null 。有什么办法吗? 另外,我也用docker-py,也有同样的问题。

最佳答案

考虑issue 23498PR 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 no ENTRYPOINT instruction in the Dockerfile).

但是,如果系统默认是 /bin/sh -c... 那对你不起作用。
参见“Default Docker entrypoint”。

关于docker - 如何提交具有空入口点的 docker 容器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51334952/

相关文章:

C++ 参数类型接受适用于基于范围的 for 循环的所有序列

environment-variables - kubernetes 默认创建了哪些环境变量

c# - 基于机会/权重返回随机值的容器

mysql - mysql db 的 Docker-Compose 服务引用在 Flask 服务中不起作用 : name 'mysqldb' not defined

docker - 在docker容器中安装CMake时出错。找不到PROTOBUF

docker - 如何让 docker-compose 构建一次镜像并重复使用它来运行容器?

docker - 拒绝 : requested access to the resource is denied: docker

docker - 版本增加React应用时如何使用Docker构建缓存?

linux - Docker - 如何检查 Dockerfile 中的 curl 命令是否有响应代码 200

Java - 在容器中显示多个 Canvas