docker容器修改並儲存
[[email protected] ~]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
sameersbn/gitlab 8.14.2 3dc4358e3a23 9 days ago 778.1 MB
sameersbn/postgresql latest 38f559f86963 8 weeks ago 232.4 MB
sameersbn/mysql latest 3e1a2409cf94 8 weeks ago 294.1 MB
sameersbn/redis latest 4c37d50ffad3 8 weeks ago 196.5 MB
[[email protected] ~]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
af1cbccfff53 sameersbn/gitlab:8.14.2 "/sbin/entrypoint.sh 7 minutes ago Up 7 minutes 0.0.0.0:80->80/tcp, 443/tcp, 0.0.0.0:10022->22/tcp gitlab
d9026497a1d0 sameersbn/mysql:latest "/sbin/entrypoint.sh 3 days ago Up 3 days 0.0.0.0:3307->3306/tcp gitlab-db
c6b2ed6d51b6 sameersbn/redis "/sbin/entrypoint.sh 3 days ago Up 3 days 6379/tcp gitlab-redis
進入容器並修改配置檔案...
sudo docker exec -it gitlab /bin/bash
[[email protected] ~]$ sudo docker commit af1cbccfff53 sameersbn/gitlab:8.14.2
30d53f0fe8a557e67bc9f68a3292f55883f2295c3bbe7202b51faa69e4e96cd3
[[email protected] ~]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
sameersbn/gitlab 8.14.2 30d53f0fe8a5 13 seconds ago 778.1 MB
sameersbn/postgresql latest 38f559f86963 8 weeks ago 232.4 MB
sameersbn/mysql latest 3e1a2409cf94 8 weeks ago 294.1 MB
sameersbn/redis latest 4c37d50ffad3 8 weeks ago 196.5 MB
從最後指令看imageid已經修改了。