我在x86 FreeBSD上。我按照这里的说明进行操作:https://wiki.freebsd.org/Docker。
当我启动docker时,我得到了
[root@udoo:dev ]# docker run -it quay.io/skilbjo/router-logs bash
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
所以我重启守护进程......
[root@udoo:dev ]# service docker start && docker -dD
Starting docker...
DEBU[0000] Registering GET, /info
DEBU[0000] Registering GET, /images/search
DEBU[0000] Registering GET, /containers/ps
... etc ....
DEBU[0000] Registering POST, /containers/{name:.*}/pause
DEBU[0000] Registering POST, /containers/{name:.*}/exec
DEBU[0000] Registering POST, /containers/{name:.*}/rename
DEBU[0000] Registering DELETE, /containers/{name:.*}
DEBU[0000] Registering DELETE, /images/{name:.*}
DEBU[0000] Registering OPTIONS,
WARN[0000] Kernel version detection is available only on linux
DEBU[0000] Warning: could not change group /var/run/docker.sock to docker: Group docker not found
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
FATA[0000] Error starting daemon: error initializing graphdriver: Failed to find zfs dataset mounted on '/var/lib/docker' in /proc/mounts
其他一些有用的信息(与文档描述完全一样):
[root@udoo:dev ]# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zroot 10.6M 3.74G 23K /zroot
zroot/docker 10.4M 3.74G 10.4M /usr/docker
[root@udoo:dev ]# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zroot 3.88G 10.6M 3.86G - 0% 0% 1.00x ONLINE -
[root@udoo:dev ]# docker version
Client version: 1.7.0-dev
Client API version: 1.19
Go version (client): go1.8.3
Git commit (client): 582db78
OS/Arch (client): freebsd/amd64
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
这里发生了什么?为什么docker守护进程不会加载?我在研究"/var/lib/docker in /proc/mounts"
时发现很少。
DEBU[0000] Warning: could not change group /var/run/docker.sock to docker: Group docker not found
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
DEBU[0000] [zfs] zfs get -rHp -t filesystem all zroot/docker2
DEBU[0000] Using graph driver zfs
DEBU[0000] Using default logging driver json-file
DEBU[0000] Creating images graph
DEBU[0000] Restored 0 elements
DEBU[0000] Creating repository list
DEBU[0000] [bridge] init driver
WARN[0000] port allocator - using fallback port range 49153-65535 due to error: open /proc/sys/net/ipv4/ip_local_port_range: no such file or directory
DEBU[0000] [bridge] found ip address: 172.17.42.1/16
FATA[0000] Error starting daemon: unknown exec driver native
答案 0 :(得分:1)
这里有几块。首先,您确实需要将/ var / lib / docker安装在ZFS上。
第二,您需要在/ etc / group中创建一个docker组。
pw groupadd docker
它看起来也像试图打procfs,在FreeBSD上,默认情况下没有启用多个版本。将此添加到/ etc / fstab
proc /proc procfs rw 0
您还需要使用足够新的FreeBSD版本。我记得它需要10.x或更高版本。
docker项目不想为FreeBSD支持获取上游补丁。在那之后,支持docker的努力就瓦解了。微软甚至试图通过在FreeBSD上为docker举办一些黑客马拉松来鼓励它。建议不要在FreeBSD上使用docker,尤其是在生产环境中。实际上,截至撰写本文时,docker-freebsd端口自2018年以来未进行任何修改。