docker镜像管理常用命令

搜索镜像

docker search nginx

在这里插入图片描述

选镜像的建议: 1,优先考虑官方 2,stars数量多 官方获取镜像网址:https:// 登录IP:918631511 邮箱:918631511@ 密码:quyunlong

获取镜像 docker pull(push) 镜像加速器:阿里云加速器,daocloud加速器,中科大加速器,Docker 中国官方镜像加速:https://

官方pull docker pull centos:6.8(没有指定版本,默认会下载最新版) 私有仓库pull docker pull /huangzhichong/alpine-cn:latest 存储小的linux系统 docker pull alpine

##配置docker镜像加速

vim /etc/docker/daemon.json
{
  "registry-mirrors": ["https://"]
}

查看镜像相关命令

docker image

在这里插入图片描述

查看镜像列表

docker images  docker image  ls

删除镜像

docker rmi  例子:docker image rm centos:latest

导出镜像

docker save  例子:docker image save centos > docker-centos7.4.tar.gz
             例子:docker image save -o docker-centos7.4.tar.gz centos

导入镜像

docker load  例子:docker image load -i docker-centos7.4.tar.gz