Docker镜像的操作

    Read

镜像是Docker的三大组件之一。

一、获取镜像

1:从仓库拉取镜像
格式:SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

docker pull [选项] [Docker Registry 地址[:端口号]/]仓库名[:标签] SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/


2:编写Dockerfile [其实还是从仓库拉取,多了很多自定义环节]

3:从 rootfs 压缩包导入
格式:SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

docker import [选项] <文件>||- [<仓库名>[:<标签>]] SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

二、列出镜像

SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

三、删除镜像

格式:SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

$ docker image rm [选项] <镜像1> [<镜像2> ...]
其中, <镜像> 可以是 镜像短 ID 、 镜像长 ID 、 镜像名 或者 镜像摘要 。 SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

单镜像:


多镜像:
SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

参考文档:
1:https://github.com/yeasy/docker_practice/tree/docker-legacy
2:https://blog.lab99.org/post/docker-2016-07-14-faq.html
3:https://docs.docker.com/develop/develop-images/dockerfile_best-practices/SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/ SourceByrd's Weblog-https://note.t4x.org/cloud/docker-get-image/

Today in History
August
14
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on August 14, 2019
  • 原文链接:https://note.t4x.org/cloud/docker-get-image/
匿名

Comment

Anonymous

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: