首页 > 系统服务 > 详细

Linux安装Docker

时间:2021-03-11 17:27:43      阅读:30      评论:0      收藏:0      [点我收藏+]

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated dependencies.

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

技术分享图片

Install using the repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

SET UP THE REPOSITORY

Install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.

 sudo yum install -y yum-utils
![](https://img2020.cnblogs.com/blog/2296296/202103/2296296-20210311100342041-1500321842.png)

#使用官方镜像
 sudo yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo
#使用阿里云加速
 sudo yum-config-manager  	--add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

技术分享图片

INSTALL DOCKER ENGINE

  1. Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

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

技术分享图片

  1. Start Docker.

     sudo systemctl status docker
     sudo systemctl enable docker
     sudo systemctl start docker
    

Uninstall Docker Engine

  1. Uninstall the Docker Engine, CLI, and Containerd packages:

    sudo yum remove docker-ce docker-ce-cli containerd.io
    
  2. Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:

     sudo rm -rf /var/lib/docker
     sudo rm -rf /var/lib/containerd
    

Linux安装Docker

原文:https://www.cnblogs.com/shizuwei/p/14516107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!