解决Centos7 Docker成功安装,但启动不了

在Centos7 成功安装,但是启动不了,报错如下:

在这里插入图片描述
[root@localhost ~]# systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.

**解决方案如下: **
[root@localhost ~]# yum remove docker
[root@localhost ~]# yum remove docker-selinux
[root@localhost ~]# vi /etc/yum.repos.d/docker.repo
在这个文件里面输入如下:
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

接着:
[root@localhost ~]# yum install docker-engine

已安装:
docker-engine.x86_64 0:1.10.2-1.el7.centos

作为依赖被安装:
docker-engine-selinux.noarch 0:1.10.2-1.el7.centos

之后就可以成功启动,如下:
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@localhost ~]# docker -v
Docker version 18.09.6, build 481bc77156
[root@localhost ~]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation?? 8123 [OK]
mariadb MariaDB is a community-developed fork of MyS?? 2761 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create?? 607 [OK]
zabbix/zabbix-server-mysql Zabbix Server with MySQL database support 192 [OK]
hypriot/rpi-mysql RPi-compatible Docker Image with Mysql 113
zabbix/zabbix-web-nginx-mysql Zabbix frontend based on Nginx web-server wi?? 101 [OK]
centurylink/mysql Image containing mysql. Optimized to be link?? 60 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 52
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5 ubuntu-16-nginx-php-phpmyadmin-mysql-5 50 [OK]
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr?? 44
tutum/mysql Base docker image to run a MySQL database se?? 31
zabbix/zabbix-web-apache-mysql Zabbix frontend based on Apache web-server w?? 29 [OK]
schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup?? 26 [OK]
bitnami/mysql Bitnami MySQL Docker Image 26 [OK]
zabbix/zabbix-proxy-mysql Zabbix proxy with MySQL database support 22 [OK]
linuxserver/mysql A Mysql container, brought to you by LinuxSe?? 20
centos/mysql-56-centos7 MySQL 5.6 SQL database server 13
mysql/mysql-router MySQL Router provides transparent routing be?? 11
circleci/mysql MySQL is a widely used, open-source relation?? 11
openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image?? 6
dsteinkopf/backup-all-mysql backup all DBs in a mysql server 6 [OK]
jelastic/mysql An image of the MySQL database server mainta?? 1
ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 0 [OK]
cloudposse/mysql Improved mysql service with support for `m?? 0 [OK]
widdpim/mysql-client Dockerized MySQL Client (5.7) including Curl?? 0 [OK]
[root@localhost ~]# docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
743f2d6c1f65: Pull complete
3f0c413ee255: Pull complete
aef1ef8f1aac: Pull complete
f9ee573e34cb: Pull complete
3f237e01f153: Pull complete
f9da32e8682a: Pull complete
4b8da52fb357: Pull complete
3416ca8f6890: Pull complete
786698c2d5de: Pull complete
4ddf84d07bd1: Pull complete
cd3aa23461b6: Pull complete
9f287a2a95ad: Pull complete
Digest: sha256:711df5b93720801b3a727864aba18c2ae46c07f9fe33d5ce9c1f5cbc2c035101
Status: Downloaded newer image for mysql:latest
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest 990386cbd5c0 41 hours ago 443MB

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值