我有一个在只读根分区上运行Ubuntu 16.04.6 LTS的Raspberry Pi 3。现在,我尝试启动docker守护程序。但是重新启动后会显示:
ubuntu@z11:~$ docker info
Client:
Debug Mode: false
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
当尝试重新启动docker守护程序时,我得到:
ubuntu@z11:~$ sudo systemctl daemon-reload
ubuntu@z11:~$ sudo systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
这是systemctl status docker.service
的输出:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
active: failed (Result: start-limit-hit) since Thu 2016-02-11 17:28:26 CET; 14s ago
Docs: https://docs.docker.com
Process: 1620 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited,status=1/FAILURE)
Main PID: 1620 (code=exited,status=1/FAILURE)
Feb 11 17:28:24 z11 systemd[1]: docker.service: Main process exited,code=exited,status=1/FAILURE
Feb 11 17:28:24 z11 systemd[1]: Failed to start Docker Application Container Engine.
Feb 11 17:28:24 z11 systemd[1]: docker.service: Unit entered failed state.
Feb 11 17:28:24 z11 systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 11 17:28:26 z11 systemd[1]: docker.service: Service hold-off time over,scheduling restart.
Feb 11 17:28:26 z11 systemd[1]: Stopped Docker Application Container Engine.
Feb 11 17:28:26 z11 systemd[1]: docker.service: Start request repeated too quickly.
Feb 11 17:28:26 z11 systemd[1]: Failed to start Docker Application Container Engine.
Feb 11 17:28:26 z11 systemd[1]: docker.service: Unit entered failed state.
Feb 11 17:28:26 z11 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
这是我的/ etc / fstab,具有一个只读的根分区和可读写的/ var / lib / docker:
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat ro 0 0
/dev/mmcblk0p2 / ext4 noatime,ro 0 0
/dev/mmcblk0p3 none swap sw 0 0
/dev/mmcblk0p4 /var/lib/docker ext4 noatime,rw 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=50m 0 0
tmpfs /var/log/apache2 tmpfs defaults,size=10m 0 0
tmpfs /var/lib/sudo tmpfs defaults,size=2m 0 0
tmpfs /tmp tmpfs defaults,mode=1777,size=30m 0 0
将根分区从ro
更改为rw
时,重新启动系统后docker运行良好。
如何让docker在保持根分区只读的情况下运行? Docker是否需要写入其他文件或目录?