请知悉:本文最近一次更新为 5年 前,文中内容可能已经过时。

不推荐直接修改容器后commit,当然,如果必须的话,那么可以继续看,毕竟dockerfile更容易看清楚每一步操作。

相关参数示例:

Name, shorthandDefaultDescription
--author , -a
Author (e.g., “John Hannibal Smith hannibal@a-team.com”)
--change , -c
Apply Dockerfile instruction to the created image
--message , -m
Commit message
--pause , -p
true
Pause container during commit

示例:

docker commit --change "ENV DEBUG true" c3f279d17e0a  svendowideit/testimage:version3

整理自:https://docs.docker.com/engine/reference/commandline/commit/#usage


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《docker commit 参数示例》相关的博文:


留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌