centos7下安裝 docker

追逐&夢想發表於2020-11-17

1、解除安裝舊版本

yum remove docker \
           docker-client \
           docker-client-latest \
           docker-common \
           docker-latest \
           docker-latest-logrotate \
           docker-logrotate \
           docker-engine

2、安裝所需的軟體包

yum install -y yum-utils \
          device-mapper-persistent-data \
          lvm2

3、設定穩定的儲存庫

yum-config-manager \
          --add-repo \
          https://download.docker.com/linux/centos/docker-ce.repo

4、安裝最新版本的Docker

yum install docker-ce docker-ce-cli containerd.io

5、啟動Docker

systemctl enable docker
systemctl start docker

6、測試

docker run hello-world

安裝docker-compose

curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

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

ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

docker-compose --version

相關文章