2020-04-05 ubuntu install docker and accelerate domestic use

1. Install

1.0 Quick installation, just a little old version, this installation method can skip the other subsequent installation steps

$ sudo docker apt install docker.io

1.1 update ubuntu apt sources Index

$ sudo apt-get update

1.2 apt to allow the installation package repository over HTTPS

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

The official added 1.3 GPG key Docker's:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

1.4 Use the following instructions to set stable version warehouse

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) \
  stable"

1.5 update package apt Index

$ sudo apt-get update
1.6 install the latest version of Docker Engine-Community and containerd 
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Docker test whether the installation is successful

$ docker --version

Print out docker version even if the installation was successful.

2. Configure mirroring accelerate

If you do not configure a mirror to accelerate, it will be very slow during the late pull

$ Sudo vim /etc/docker/daemon.json

Added to the configuration file:

{
  "registry-mirrors": ["https://hub-mirror.c.163.com"]
}

After the restart Docker save changes to the configuration.

$ sudo service docker restart 

Guess you like

Origin www.cnblogs.com/cxl-blog/p/12640053.html