Widnows Docker: запуск клиента Docker внутри контейнера Docker - PullRequest
0 голосов
/ 29 апреля 2020

Я установил Windows Docker и запустил команду basi c docker run для запуска контейнера CentOS следующим образом:

docker run --name centos -d -p 8080:80 -it centos /bin/bash

Я пытаюсь выполнить exe c в Контейнер для тестирования некоторых скриптов, которые зависят от установки и использования клиента Docker внутри контейнера. Клиент Docker не может запуститься и встречает эту ошибку:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

$ docker info

[root@099941e63798 /]# 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

$ dockerd

[root@099941e63798 /]# dockerd
INFO[2020-04-29T00:21:01.015246386Z] Starting up
INFO[2020-04-29T00:21:01.016822486Z] libcontainerd: started new containerd process  pid=437
INFO[2020-04-29T00:21:01.016877486Z] parsed scheme: "unix"                         module=grpc
INFO[2020-04-29T00:21:01.016900186Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-04-29T00:21:01.016935086Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-04-29T00:21:01.016954786Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-04-29T00:21:01.060022682Z] starting containerd                           revision=894b81a4b802e4eb2a91d1ce216b8817763c29fb version=1.2.6
ERRO[2020-04-29T00:21:01.061470182Z] failed to change OOM score to -500            error="write     /proc/437/oom_score_adj: permission denied"
INFO[2020-04-29T00:21:01.062060682Z] loading plugin "io.containerd.content.v1.content"...      type=io.containerd.content.v1
INFO[2020-04-29T00:21:01.062282482Z] loading plugin "io.containerd.snapshotter.v1.btrfs"...      type=io.containerd.snapshotter.v1
WARN[2020-04-29T00:21:01.062732182Z] failed to load plugin io.containerd.snapshotter.v1.btrfs      error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs     filesystem to be used with the btrfs snapshotter"
INFO[2020-04-29T00:21:01.062757182Z] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
WARN[2020-04-29T00:21:01.066745082Z] failed to load plugin io.containerd.snapshotter.v1.aufs  error="modprobe aufs failed: "modprobe: FATAL: Module aufs not found in directory /lib/modules/4.19.76-linuxkit\n": exit status 1"
INFO[2020-04-29T00:21:01.066832682Z] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
INFO[2020-04-29T00:21:01.067143782Z] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
INFO[2020-04-29T00:21:01.067488782Z] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
WARN[2020-04-29T00:21:01.067890582Z] failed to load plugin io.containerd.snapshotter.v1.zfs  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter"
INFO[2020-04-29T00:21:01.067915582Z] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
WARN[2020-04-29T00:21:01.068030782Z] could not use snapshotter btrfs in metadata plugin  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"
WARN[2020-04-29T00:21:01.068045782Z] could not use snapshotter aufs in metadata plugin  error="modprobe aufs failed: "modprobe: FATAL: Module aufs not found in directory /lib/modules/4.19.76-linuxkit\n": exit status 1"
WARN[2020-04-29T00:21:01.068060082Z] could not use snapshotter zfs in metadata plugin  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter"
INFO[2020-04-29T00:21:01.085272880Z] loading plugin "io.containerd.differ.v1.walking"...  type=io.containerd.differ.v1
INFO[2020-04-29T00:21:01.085336780Z] loading plugin "io.containerd.gc.v1.scheduler"...  type=io.containerd.gc.v1
INFO[2020-04-29T00:21:01.085392980Z] loading plugin "io.containerd.service.v1.containers-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085664480Z] loading plugin "io.containerd.service.v1.content-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085694980Z] loading plugin "io.containerd.service.v1.diff-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085742080Z] loading plugin "io.containerd.service.v1.images-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085781380Z] loading plugin "io.containerd.service.v1.leases-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085802180Z] loading plugin "io.containerd.service.v1.namespaces-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085848080Z] loading plugin "io.containerd.service.v1.snapshots-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.085870180Z] loading plugin "io.containerd.runtime.v1.linux"...  type=io.containerd.runtime.v1
INFO[2020-04-29T00:21:01.086139280Z] loading plugin "io.containerd.runtime.v2.task"...  type=io.containerd.runtime.v2
INFO[2020-04-29T00:21:01.086438080Z] loading plugin "io.containerd.monitor.v1.cgroups"...  type=io.containerd.monitor.v1
INFO[2020-04-29T00:21:01.087278780Z] loading plugin "io.containerd.service.v1.tasks-service"...  type=io.containerd.service.v1
INFO[2020-04-29T00:21:01.087410880Z] loading plugin "io.containerd.internal.v1.restart"...  type=io.containerd.internal.v1
INFO[2020-04-29T00:21:01.087494580Z] loading plugin "io.containerd.grpc.v1.containers"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.087538880Z] loading plugin "io.containerd.grpc.v1.content"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.087585480Z] loading plugin "io.containerd.grpc.v1.diff"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.087718380Z] loading plugin "io.containerd.grpc.v1.events"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.087756380Z] loading plugin "io.containerd.grpc.v1.healthcheck"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.087788680Z] loading plugin "io.containerd.grpc.v1.images"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.088464680Z] loading plugin "io.containerd.grpc.v1.leases"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.088594080Z] loading plugin "io.containerd.grpc.v1.namespaces"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.088674480Z] loading plugin "io.containerd.internal.v1.opt"...  type=io.containerd.internal.v1
INFO[2020-04-29T00:21:01.089015480Z] loading plugin "io.containerd.grpc.v1.snapshots"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.089082880Z] loading plugin "io.containerd.grpc.v1.tasks"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.089104380Z] loading plugin "io.containerd.grpc.v1.version"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.089118980Z] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[2020-04-29T00:21:01.089530880Z] serving...                                    address="/var/run/docker/containerd/containerd-debug.sock"
INFO[2020-04-29T00:21:01.090845880Z] serving...                                    address="/var/run/docker/containerd/containerd.sock"
INFO[2020-04-29T00:21:01.091000080Z] containerd successfully booted in 0.035064s
INFO[2020-04-29T00:21:01.113515678Z] parsed scheme: "unix"                         module=grpc
INFO[2020-04-29T00:21:01.113561678Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-04-29T00:21:01.113665878Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-04-29T00:21:01.113824978Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-04-29T00:21:01.118070277Z] parsed scheme: "unix"                         module=grpc
INFO[2020-04-29T00:21:01.118122577Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-04-29T00:21:01.118145977Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-04-29T00:21:01.118156577Z] ClientConn switching balancer to "pick_first"  module=grpc
ERRO[2020-04-29T00:21:01.121279077Z] failed to mount overlay: operation not permitted  storage-driver=overlay2
ERRO[2020-04-29T00:21:01.130002876Z] AUFS was not found in /proc/filesystems       storage-driver=aufs
ERRO[2020-04-29T00:21:01.130725676Z] failed to mount overlay: operation not permitted  storage-driver=overlay
WARN[2020-04-29T00:21:01.131516776Z] Unable to setup quota: operation not permitted
INFO[2020-04-29T00:21:01.198862670Z] Loading containers: start.
WARN[2020-04-29T00:21:01.202063870Z] Running modprobe bridge br_netfilter failed with message:     modprobe:     WARNING: Module bridge not found in directory /lib/modules/4.19.76-linuxkit
modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/4.19.76-linuxkit
, error: exit status 1
WARN[2020-04-29T00:21:01.205590370Z] Running iptables --wait -t nat -L -n failed with message:     `iptables: Permission denied (you must be root).
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination`, error: exit status 1
INFO[2020-04-29T00:21:01.260277965Z] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
INFO[2020-04-29T00:21:01.261836365Z] stopping healthcheck following graceful shutdown  module=libcontainerd
INFO[2020-04-29T00:21:01.261855665Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
failed to start daemon: Error initializing network controller: error obtaining controller instance:     failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables: Permission     denied (you must be root).
 (exit status 1)

I Я довольно новичок в Docker на Windows и не очень знаком с окружающей средой. Достиг ли я ограничения или есть решение для этого?

...