赞
踩
yum update
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
yum install -y yum-utils
yum install -y device-mapper-persistent-data
yum install -y lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 如果连接超时,可以使用alibaba源
# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
docker -v
https://blog.csdn.net/zhou920786312/article/details/118212302
七、docker安装
默认情况下,将来从docker hub(https://hub.docker.com/)上下载docker镜像,太慢。一般都会配置镜像加速器。
sudo mkdir -p /etc/docker sudo vim /etc/docker/daemon.json { "data-root": "/home/hd/docker/data", "registry-mirrors": [ "http://hub-mirror.c.163.com", "https://fsqbo5wy.mirror.aliyuncs.com", "https://registry.docker-cn.com" ] }
sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl enable docker
#添加docker用户组
sudo groupadd docker
#将登陆用户加入到docker用户组中
sudo gpasswd -a $USER docker
#更新用户组
newgrp docker
退出当前shell终端,重新登录,使得上面配置生效
# 启动 sudo service docker start # 重启 sudo service docker restart # 停止 sudo service docker stop # 查看状态 sudo service docker status # 启动 sudo systemctl start docker # 重启 sudo systemctl restart docker # 停止 sudo systemctl stop docker # 查看状态 sudo systemctl status docker # 重新加载配置 sudo systemctl daemon-reload # 设置开机启动 systemctl enable docker # 查看docker概要信息 docker info # 查看docker帮助文档 docker --help
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。