6.docker镜像管理命令

指令描述
export导出容器文件系统到tar归档文件
Import导入容器文件系统tar归档文件创建镜像
save保存一个或多个镜像到一个tar归档文件
load家在镜像来自tar归档或标准输入
[root@docker nginx]# docker image --help

Usage:	docker image COMMAND

Manage images

Commands:
  build       Build an image from a Dockerfile
  history     Show the history of an image
  import      Import the contents from a tarball to create a filesystem image
  inspect     Display detailed information on one or more images
  load        Load an image from a tar archive or STDIN
  ls          List images
  prune       Remove unused images
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rm          Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

1.保存镜像

docker image save nginx:1.11 > nginx:1.11tar

2.导入镜像

docker load < nginx:1.11tar

3.列出镜像

docker images ls

4.查看一个镜像的历史分层

docker images history

5.查看详情

docker image inspect $镜像

6.拉取镜像

docker image pull nginx:1.1.1

7.推送镜像

docker image push

8.删除镜像

docker image rm nginx:1.12

9.打tag

docker tag nginx:1.11 nginx:v1

10.从容器导出文件为sky.tar

docker export 6ded32348de2 > sky.tar

11.从文件导入镜像为s1

docker image import sky.tar s1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云原生解决方案

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值