00-Docker基本安装
00-Docker基本安装
Docker Version: 19.03.5
😄 Written by Zak Zhu
参考
- Breeze老师的docker培训
- 马哥docker视频
- 阿里云OPSX镜像站
安装与配置
-
添加yum repository
-
CentOS-Base.repo
wget http://mirrors.aliyun.com/repo/Centos-7.repo \ -O /etc/yum.repos.d/CentOS-Base.repo
-
epel.repo
wget http://mirrors.aliyun.com/repo/epel-7.repo \ -O /etc/yum.repos.d/epel.repo
-
docker-ce.repo
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \ -O /etc/yum.repos.d/docker-ce.repo
-
-
安装docker-ce
yum install docker-ce -y
-
创建docker configuration
-
mkdir /etc/docker/
-
vim /etc/docker/daemon.json
{ "registry-mirrors": ["阿里云镜像加速器地址"] }
-
启动与测试
-
重启docker并使能开机自启
systemctl enable docker systemctl restart docker
-
测试跑一个docker容器
docker container run -d busybox