Docker安装

  • 如果之前已经安装,先卸载旧版本的docker
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-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
  • 安装docker
yum install docker-ce docker-ce-cli containerd.io
  • 启动docker
systemctl start docker
  • 验证docker
docker run hello-world
posted @ 2021-12-05 11:16  弩哥++  阅读(27)  评论(0编辑  收藏  举报