centos7安装docker以及镜像命令

一.安装docker

1.参考官方文档:https://docs.docker.com/install/linux/docker-ce/centos/

二、配置镜像加速

2.阿里云镜像加入地址:https://cr.console.aliyun.com/undefined/instances/mirrors

三、docker常用命令

辅助类命令
1.docker version
2.docker info
3.docker --help
镜像类命令:
1.docker images 列出本机镜像
centos7安装docker以及镜像命令
centos7安装docker以及镜像命令
2.docker search 镜像名字 —查找镜像
centos7安装docker以及镜像命令
docker search tomcat -s 30 ---------列出收藏数不小于30的镜像
centos7安装docker以及镜像命令
3.下载镜像

docker pull tomcat 等于docker pull tomcat:latest -------没写版本号为下载tomcat最新版
4.删除镜像:
docker rmi hello-world ---------删除hello-world镜像,删除没在运行的镜像(镜像后没写版本号,默认删除latest版的镜像)
centos7安装docker以及镜像命令
镜像正在运行,需要强制删除
docker rmi -f hello-world
centos7安装docker以及镜像命令
删除多个镜像:
centos7安装docker以及镜像命令
删除全部镜像:
docker rmi -f $(docker images -qa)