Install Docker on CentOS7. The installation is successful. Error is reported when starting

Keywords: Docker Linux yum JSON

The steps to install Docker on CentOs7 are as follows:
First, we need to check the version, because the installation of Docker kernel on linux must be above 3.0

uname -r
  1. Install docker yum install docker
  2. You will be prompted to enter y to continue during installation
  3. After installation, you can check the version of docker -v
  4. Start the docker command systemctl start docker. An error will be reported here, which will be solved as follows
  5. Set docker to start systemctl enable docker
  6. Restart docker systemctl restart docker
  7. Stop docker systemctl stop docker

Error is reported at startup:

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

Execute the prompt command systemctl status docker.service
The contents are as follows:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-05-20 13:13:33 EDT; 28s ago
     Docs: http://docs.docker.com
  Process: 5379 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/do                                  cker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=system                                  d --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/do                                  cker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE                                  _OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIE                                  S (code=exited, status=1/FAILURE)
 Main PID: 5379 (code=exited, status=1/FAILURE)

May 20 13:13:31 localhost.localdomain systemd[1]: Starting Docker Application Container.....
May 20 13:13:31 localhost.localdomain dockerd-current[5379]: time="2019-05-20T13:13:31.5..."
May 20 13:13:31 localhost.localdomain dockerd-current[5379]: time="2019-05-20T13:13:31.5..."
May 20 13:13:32 localhost.localdomain dockerd-current[5379]: time="2019-05-20T13:13:32.53...
May 20 13:13:33 localhost.localdomain dockerd-current[5379]: Error starting daemon: SELi...)
May 20 13:13:33 localhost.localdomain systemd[1]: docker.service: main process exited, ...RE
May 20 13:13:33 localhost.localdomain systemd[1]: Failed to start Docker Application Co...e.
May 20 13:13:33 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
May 20 13:13:33 localhost.localdomain systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

terms of settlement:
Open the configuration file of docker: vi /etc/sysconfig/docker
Modify the following location:

Restart succeeded after modification.

Posted by Design on Thu, 07 Nov 2019 13:17:17 -0800