1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| # 安装必须的依赖 sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 # 设置docker repo的yum源 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo # 安装docker,以及docker-cli sudo yum install -y docker-ce docker-ce-cli containerd.io # 配置docker加速(可选) sudo mkdir -p /etc/docker sudo tee /etc/docker/deamon.json <<-'EOF' { "registry-mirrors":["https://82m9ar63.mirror.aliyuncs.com"] } EOF sudo systemctl deamon-reload sudo systemctl restart docker # 配置开机启动 sudo systemctl enable docker
|