Docker Commit Created Images and ENTRYPOINT

前端 未结 2 426
夕颜
夕颜 2020-12-25 11:30

How do you ensure that the original CMD specified in your Dockerfile is still set to run on docker run, when you make changes via docker commit?

2条回答
  •  既然无缘
    2020-12-25 12:20

    Current Docker versions (I'm on 1.11.1) provide a --change option that allow in-line manipulation of the image at commit time, as in:

    docker commit --change='ENTRYPOINT ["myEntryPoint.sh"]' $(docker ps -lq)
    

    CMD is also supported as are a few others. See manpage for more details and examples.

提交回复
热议问题