This is the 9th day of my participation in Gwen Challenge

Hello, everyone, MY name is Data-mining, alias Liuzhen007 (Chinese Bond, a code-tapping Bond). I have worked for traditional radio and television giants and audio and video Internet companies successively. I have rich experience in audio and video live broadcast and on-demand. Very deep understanding of WebRTC, FFmpeg and Electron.

The problem

I applied for a new aliyun server and planned to deploy a container service on it, only to find that docker was not installed on the machine. How can I stand it? Must solve ah! That’s impossible. It’s a waste of time. Do it yourself.

Docker: Command Not Found

To solve

In view of this problem, I have specially recorded it today.

Let’s look at how to install Docker on a Linux server.

Step 1: Update the YUM package

To update information about the yum package management tool library, run the following command:

yum update

Step 2: Install the dependency package

To install other dependency packages required by the Docker environment, run the following command:

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

Step 3 set up the yum source

To set up the yum toolkit source repository, run the following command:

Yum – config – manager – add – repo download.docker.com/linux/cento…

Step 4: Install docker

Docker installation package, here we select the community version, can be used for free, execute the following command:

yum install docker-ce 

Note: The latest stable version of Docker is installed by default.

Step 5: Start the Docker service

To use the docker command, run the following command:

systemctl start docker

Sixth step, set the boot automatically

We had better set the Docker service to start automatically after startup, so that we do not need to manually enable Docker every time, execute the following command:

systemctl enable docker 

OK!

The last

You can use the docker version command to view the docker version information. Run the following command:

docker version

If the docker container service is successfully installed, the following output will be displayed:

Client: Docker Engine - Community
 Version:           20.106.
 API version:       1.41
 Go version:        go113.15.
 Git commit:        370c289
 Built:             Fri Apr  9 22:47:12 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.106.
  API version:      1.41 (minimum version 1.12)
  Go version:       go113.15.
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:45:24 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.46.
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0. 0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19. 0
  GitCommit:        de40ad0
Copy the code

Of course, each machine or each version will be slightly different, the above information is for reference only!