[root@host103 ~]# docker tag nginx:latest nginx:nginx01 [root@host103 ~]# docker images | grep nginx nginx latest f8f4ffc8092c 8 days ago 133MB nginx nginx01 f8f4ffc8092c 8 days ago 133MB
[root@host103 ~]# docker tag nginx:latest web:nginx01 [root@host103 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest f8f4ffc8092c 8 days ago 133MB nginx nginx01 f8f4ffc8092c 8 days ago 133MB web nginx01 f8f4ffc8092c 8 days ago 133MB
删除镜像
1 2 3 4 5 6 7 8
格式1: docker rmi 仓库名称:标签
当一个镜像有多个标签时,只是删除其中指定的标签
格式2: docker rmi 镜像ID [-f]
会彻底删除镜像
存储镜像
将镜像保存为本地文件。
格式: docker save -o 存储文件名 存储的镜像
1 2 3
[root@host103 ~]# docker save -o /opt/nginx nginx:latest [root@host103 ~]# ls /opt/nginx /opt/nginx
载入镜像
将镜像文件导入到镜像仓库中
格式1: docker load < 存储的文件
格式2: docker load i 存储的文件
1 2 3 4 5
[root@host103 ~]# docker load < /opt/nginx [root@host103 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest f8f4ffc8092c 8 days ago 133MB