咸鱼

咸鱼是以盐腌渍后,晒干的鱼

0%

6、Docker-无法启动

控制docker

1
2
3
$ sudo systemctl start docker
或者
$ sudo service docker start

报错

当尝试用docker时,提示以下错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
root@bogon:~# docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@bogon:~# docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@bogon:~#
root@bogon:~#
root@bogon:~# systemctl status docker.service
● docker.service - LSB: Create lightweight, portable, self-sufficient containers.
Loaded: loaded (/etc/init.d/docker; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-07-08 10:52:45 CST; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 19187 ExecStart=/etc/init.d/docker start (code=exited, status=1/FAILURE)

Jul 08 10:52:45 bogon systemd[1]: Stopped LSB: Create lightweight, portable, self-sufficient containers..
Jul 08 10:52:45 bogon systemd[1]: Starting LSB: Create lightweight, portable, self-sufficient containers....
Jul 08 10:52:45 bogon docker[19187]: * /usr/bin/dockerd not present or not executable
Jul 08 10:52:45 bogon systemd[1]: docker.service: Control process exited, code=exited status=1
Jul 08 10:52:45 bogon systemd[1]: Failed to start LSB: Create lightweight, portable, self-sufficient containers..
Jul 08 10:52:45 bogon systemd[1]: docker.service: Unit entered failed state.
Jul 08 10:52:45 bogon systemd[1]: docker.service: Failed with result 'exit-code'.

root@bogon:~#
root@bogon:~#
root@bogon:~# systemctl restart 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.

卸载重装

暂时没找到好的方法,只能重装了。这里用 --purge卸载及删除配置文件,但是docker镜像不会被删除。

1
2
3
4
5
6
7
root@bogon:~# sudo apt-get remove docker-ce --purge
root@bogon:~# apt-get install docker-ce
root@bogon:~# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7598613e479b grafana/grafana "/run.sh" 2 months ago Exited (0) 2 months ago grafana
bf7a8866a780 influxdb "/entrypoint.sh infl…" 2 months ago Exited (0) 3 weeks ago influxDbService
bab8133e7c9e hello-world "/hello" 2 months ago Exited (0) 2 months ago reverent_euclid