Docker container installation under Linux (based on Ubuntu)

 

 

Docker container will not be introduced, today is mainly installation, installation, and installation!

Today we are mainly based on the official Guide to complete an installation, refer to: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce

There are two main versions of Docker, Docker Community Edition (CE), Docker Enterprise Edition (EE), the CE version is the community version, and EE is the enterprise version (well, it costs money if you use it, and is powerful)

The community version does not cost money and has limited functions. As the official said, it is mainly for development, and some small teams, familiar with and practicing:

Docker Community Edition (CE) is ideal for individual developers and small teams looking to get started with Docker and experimenting with container-based apps.

So today we are going to install the CE version!

The system we are installing and using today is Ubuntu 16.04

You can also see

First, the official installation under Ubuntu is the basic installation environment requirement:

  • Cosmic 18.10
  • Bionic 18.04 (LTS)
  • Xenial 16.04 (LTS)

Let's meet the conditions here!

The next step is to uninstall the old version. It is the default that everyone is installing for the first time. (It seems that it is not the first time to install, and may not read this article, haha)

There are two official installation methods, one is to use the Docker warehouse, and the other is to download the installation package and install manually

Let's choose the first method to use Docker warehouse, which is convenient and the official recommended solution

1. Add warehouse first

 

1. Update the apt index

$ sudo apt-get update

I am using Tencent Cloud here, and the mirror address of Tencent is also directly changed to their home address:

2. Allow the use of HTTPS repositories during installation:

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

 

3. Add Docker's official GPG key:

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

Here the official let us check the fingerprint of the added key, and whether it is consistent with the official (9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88) to ensure that it is foolproof

Check it after using 8 bits:

$ sudo apt-key fingerprint 0EBFCD88

 4. Next, we need to set up the warehouse where we want to get the following version, here are, stable, nightly, nightly, let’s choose the stable version here

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

2. Start the installation

1. Update the apt index:

$ sudo apt-get update

2. Install the latest CE, containerd, and you can also install the specified version. If you don't write here, install the latest version.

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Because you need to download some installation packages, the installation speed depends on your server-side network, so you can wait patiently!

3. Verify the installation results:

$ sudo docker run hello-world

Look at the version again:

If the above information is printed out, congratulations, the installation is successful! !

 

 

Guess you like

Origin blog.csdn.net/kevin_mails/article/details/94437303