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
- Install docker yum install docker
- You will be prompted to enter y to continue during installation
- After installation, you can check the version of docker -v
- Start the docker command systemctl start docker. An error will be reported here, which will be solved as follows
- Set docker to start systemctl enable docker
- Restart docker systemctl restart docker
- 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.