---> 979f95edc03b
Removing intermediate container ad6e4604aede
Step 14/14 : CMD /run.sh
---> Running in 8f1209324969
---> a0bdb7bb13ad
Removing intermediate container 8f1209324969[root@test3 ningx]# docker run -d -P nginx:new
f2855c4f4732435cfa3a8c9e17af8540c874577228f8276013260b2d9474e50b[root@test3 ningx]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f2855c4f4732 nginx:new "/run.sh" 6 seconds ago Up 4 seconds 0.0.0.0:32769->80/tcp, 0.0.0.0:32768->443/tcp clever_gates
测试
注:把镜像保存到本地
[root@test3 ~]# docker save -o centos_nginx.tar nginx:new
centos_nginx.tar 为保存到本地后的包名
nginx:new 为被打包的对象镜像
如果在一台新机器还原docker镜像
[root@test2 ~]# docker load --input centos_nginx.tar
······
Loaded image: nginx:new
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx