云服务器CentOS安装Docker

安装yum-utils device-mapper-persistent-data lvm2软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
添加阿里源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
查看可用docker版本
yum list docker-ce --showduplicates | sort -r
安装docker
yum install docker-ce-18.03.1.ce-1.el7.centos
//启动
systemctl start docker
//停止dcoker
systemctl stop docker
//设置开机启动
systemctl enable docker
//重启docker
systemctl restart docker
//查看docker
docker info
Docker容器自动启动设置
docker update --restart=always <CONTAINER ID>
关闭自动重启
docker update restart=no  <CONTAINER ID>

 

设置镜像源
vi /etc/docker/daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
systemctl restart docker.service
搜索 docker 镜像 https://hub.docker.com/
 
 
posted @ 2021-02-13 10:47  netcorner  阅读(77)  评论(0编辑  收藏  举报