docker install and uninstall on a host computer centos7

In this paper, allowing users on the system centos7, install and uninstall the practical operation docker in order to later learn for docker.

table of Contents


- basic environment ready
- to uninstall the old version of docker
- installation docker-ce
- unloading docker-ce

Basic environment ready


docker install my operating system centos7.4 here, use yum install docker. Overlay2 recommended storage drive file system;

Uninstall the old version of docker


The old version is also known as docker docker or docker-engine, if already installed on your machine, uninstall them.

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

Note: After you uninstall the docker, the original image, container, persistent storage and networks are protected, they are stored in / var / lib / docker / directory structure below;

Installation of three ways docker-ce

Docker installation of three ways:

  1. Most users docker's yum repositories to install, which is the recommended installation;
  2. There are also users rpm package installation;
  3. In some test environment or development environment, the user selects the way the automated installation scripts to install docker.

Now I will use the docker's yum repository to install:
Step one: download the official yum source of docker-ce

wget https://download.docker.com/linux/centos/docker-ce.repo -O  /etc/yum.repos.d/docker-ce.repo 

Step two: Access to those available in the fixed version docker-ce

yum list docker-ce --showduplicates | sort -r

Step three: a fixed mounting docker-ce version docker-ce-18.06.3.ce-3.el7

yum install docker-ce-18.06.3.ce-3.el7

docker unloading

docker unloading in two steps:

  1. Delete the installation package

    yum -y remove docker-ce
  2. On our hosts mirror, container, volume, and does not automatically delete the custom configuration file, if you want to delete them, execute the following command:

    rm -rf /var/lib/docker

Guess you like

Origin www.cnblogs.com/chenxiba/p/11320379.html
Recommended