CentOS8安装docker

1、安装yum-utils

sudo yum install -y yum-utils


2、添加源

sudo yum-config-manager \

    --add-repo \

    https://download.docker.com/linux/centos/docker-ce.repo


3、Enable the nightly or test repositories

sudo yum-config-manager --enable docker-ce-nightly

sudo yum-config-manager --enable docker-ce-test


4、安装最新的Docker和Containerd

sudo yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm

sudo yum install docker-ce docker-ce-cli


5、启动Docker

sudo systemctl start docker


6、配置docker开机自启动

sudo systemctl enable docker


7、检测Docker版本

docker -v


8、安装Compose

curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

yum -y install epel-release

yum -y install python-pip


9、Apply executable permissions to the binary:

sudo chmod +x  /usr/local/bin/docker-compose

你可能感兴趣的:(CentOS8安装docker)