1.虚拟化容器技术,基于镜像。秒启各种容器,每一个容器就是一个完整地运行环境,环境之间相互隔离;
2.docker安装地址:https://docs.docker.com/install/linux/docker-ce/centos/
2.1第一步:卸载docker
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2.2第二步:安装依赖包
$ sudo yum install -y yum-utils
2.3第三步:设置存储库
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
2.4第四步:安装docker引擎
$ sudo yum install docker-ce docker-ce-cli containerd.io
2.5第五步:启动docker
$ sudo systemctl start docker
2.6第六步:设置docker开机自启
$ sudo systemctl enable docker
2.7第七步:配置国内镜像(采用阿里)
$ sudo mkdir -p /etc/docker
$ sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://rkwicwuk.mirror.aliyuncs.com"]
}
EOF
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
3.docker常用命令
$ sudo docker images
$ sudo docker images rm (CREATE)
$ sudo docker images rm (CREATE)
$ sudo docker ps -a
$ sudo docker rm (CONTAINER ID )
$ docker rm $(docker ps -a -q)
$ docker rmi $(docker images -q)