Installation and upgrade of docker-ce

docker CE Community Edition, Docker EE Enterprise Edition

docker CE installation

First, using a mirror mounted warehouse

   First installed on the new host Docker CE before, you need to set Docker image storage. Then, you can install and update from mirror warehouse Docker

Set up a mirrored warehouse

        1, yum-utils  provides  yum-config-manager  utility, and  devicemapper  storage driver needs  devicemapper-persistent-data  and  lvm2

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

2, using the following command set  stable  image repository. You always need to use the  stable  image warehouses, even if you also need to  edge  or  testing  mirroring install warehouse building as well.

ps: New is not installed yum before the source:

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

ps: After Run a plurality docker-ce.repo image warehouse

3 , update  yum  package index

makecache the FAST yum (build local cache)

4, lists the available versions. This example uses the  sort -r  command by version number to sort the results (from highest to lowest)

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

5, install a specific version

yum -y install docker-ce-<VERSION>

For example: yum the install Docker -Y-CE-18.06.3.ce-3.el7

6 / boot from Kai

systemctl start docker

systemctl enable docker

7 / View Auto-start service

systemctl list-unit-files

Two , Docker upgrade

1 / Stop d Ocker Service

     systemctl stop docker

2 / delete the old version

 yum -y remove docker-common docker-selinux docker-engine

3 / install the specified version

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

4 / View version

 docker -v

Guess you like

Origin www.cnblogs.com/lucifer1889/p/11590562.html