若有个名为nginx的容器:
docker run -it nginx bash
修改内容后退出,使用docker commit
命令提交修改。
Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Create a new image from a container's changes
Options:
-a, --author string Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
-c, --change list Apply Dockerfile instruction to the created image
-m, --message string Commit message
-p, --pause Pause container during commit (default true)
如 :
docker commit -a "John Click" -m "add extra plugins" 2ff7f15ca033 nginx:latest
2ff7f15ca033
为刚才修改的docker容器id。