Docker Summary of Pit of Problems Encountered in Installing Alibaba Cloud Server and Virtual Machine Installation

  • 2021-10-16 05:33:25
  • OfStack

Docker Installation (Alibaba Cloud Server)

Docker Official centos Installation Tutorial

Uninstall the old version


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

Installation using repositories

Before installing Docker Engine for the first time on a new host, you need to set up the Docker repository. After that, you can install and update Docker from the repository.

Set up the repository

Installation yum-utils Software package (provided yum-config-manager Utility and set up a stable repository.


$ sudo yum install -y yum-utils

$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Installing the DOCKER engine

Install the latest version of Docker Engine and container


$ sudo yum install docker-ce docker-ce-cli containerd.io

Start Docker


$ sudo systemctl start docker

By running hello-world Image to verify that Docker Engine is installed correctly


$ sudo docker run hello-world

Uninstall Docker

Uninstall the Docker Engine, CLI, and Containerd packages:


$ sudo yum remove docker-ce docker-ce-cli containerd.io

Images, containers, volumes, or custom profiles on the host are not automatically deleted. To delete all images, containers, and volumes:


$ sudo rm -rf /var/lib/docker

You must manually delete all edited profiles.

Centos7 Virtual Machine Installation Docker

There are many tutorials on the Internet, and bloggers report errors during the installation process as follows:

Job for docker. service failed because the control process error error code details. See "systemctl status details" journalctl-xe "for details.

Use systemctl status docker to view details as

Feb 19 15:39:43 centos7 systemd[1]: Failed to start Docker Application Container Engine.

Look at the docker version, only client, no server terminal

Solution

Execute vi/etc/sysconfig/selinux, changing the selinux property value to disabled. Then restart the system; docker started successfully!


SELinux(Security-Enhanced Linux)  The National Security Agency ( NSA ) For the implementation of mandatory access control, 
 Yes  Linux The most outstanding new security subsystem in history. But we 1 Like bai Don't even use it, 
 Because it manages too many things, you can use firewalls and other measures to do security. 
SELinux Shared 3 State enforcing  (Under implementation), permissive  (Do not execute but generate warnings), 
disabled (Close) 

Related articles: