镜像的获取方式

pull from registry(online)从registry拉取
public(公有)
pricate(私有)
build from dockerfile(online) 从Dockerfile构建
load from file(offline)文件导入(离线)

相关命令

  1. docker image pull # 拉取默认版本latest
  2. docker image 1s # 查看镜像
  3. docker image pull nginx:1.20.0 # 拉取特定版本
  4. docker image inspect # 显示镜像更多详细的信息
  5. docker image rm <镜像id # 删除
  6. docker image save nginx:1.20.0 -o nginx.image # 镜像的导出
  7. docker image load -i .\nginx.image # 镜像的导入并生成
  8. docker image build-t hello:1.0 . # 镜像的构建-指定新的名字
  9. docker image build -f/path/to/a/Dockerfile . # 指定构建文件路径
  10. docker image tag <旧镜像><新镜像> # 根据已有的镜像生成一个新的tag镜像
  11. docker image history <id or name> # 分层解析