在Google Colab上运行Docker

chu

我正在尝试在Google Colab上运行Docker,但遇到了一些麻烦。我遵循了在Ubuntu(https://docs.docker.com/engine/install/ubuntu/上安装Docker的步骤,这些步骤与其他人在Digital Ocean(https://上安装它的步骤)非常相似。colab.research.google.com/drive/10OinT5ZNGtdLLQ9K399jlKgNgidxUbGP#scrollTo=9zp-VmLsws2r)。

我能够成功安装Docker,我知道这一点,因为在运行时,docker --version我得到以下输出:Docker version 19.03.11, build 42e35e61f3,并且从未收到任何错误,指出该命令docker未被识别。

但是当我尝试运行时sudo docker run hello-world --priveleged,得到的输出是:docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

我通过运行进行了一些诊断sudo dockerd --debug,输出如下。我已经检查过,并且iptables我的内核都已完全升级。运行whoami收益root有些人建议重启内核,但这也无济于事。

这似乎是Google Colab特有的问题,但我无法弄清楚到底出了什么问题。有人有想法吗?如果您需要更多信息,请告诉我。

谢谢,

这正是我在Google Colab中运行的代码:

%%shell
sudo curl -fsSL https://get.docker.com/ | sh
sudo usermod -aG docker root
sudo docker run hello-world --priveleged
sudo dockerd --debug

这是错误:

INFO[2020-06-06T22:08:10.430389079Z] Starting up                                  
DEBU[2020-06-06T22:08:10.430968786Z] Listener created for HTTP on unix (/var/run/docker.sock) 
DEBU[2020-06-06T22:08:10.430993252Z] Containerd not running, starting daemon managed containerd 
INFO[2020-06-06T22:08:10.431768021Z] libcontainerd: started new containerd process  pid=19853
INFO[2020-06-06T22:08:10.431817137Z] parsed scheme: "unix"                         module=grpc
INFO[2020-06-06T22:08:10.431844607Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-06-06T22:08:10.431872314Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-06-06T22:08:10.431886205Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-06-06T22:08:10.460579142Z] starting containerd                           revision=7ad184331fa3e55e52b890ea95e65ba581ae3429 version=1.2.13
DEBU[2020-06-06T22:08:10.460646512Z] changing OOM score to -500                   
ERRO[2020-06-06T22:08:10.460696793Z] failed to change OOM score to -500            error="write /proc/19853/oom_score_adj: permission denied"
INFO[2020-06-06T22:08:10.460996041Z] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
INFO[2020-06-06T22:08:10.461036833Z] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
WARN[2020-06-06T22:08:10.461276128Z] 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-06-06T22:08:10.461294855Z] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
WARN[2020-06-06T22:08:10.462332024Z] 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.104+\n": exit status 1"
INFO[2020-06-06T22:08:10.462354904Z] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
INFO[2020-06-06T22:08:10.462404944Z] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
INFO[2020-06-06T22:08:10.462528569Z] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
INFO[2020-06-06T22:08:10.462929351Z] skip loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
INFO[2020-06-06T22:08:10.462950017Z] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
WARN[2020-06-06T22:08:10.462975101Z] 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-06-06T22:08:10.462987603Z] could not use snapshotter aufs in metadata plugin  error="modprobe aufs failed: "modprobe: FATAL: Module aufs not found in directory /lib/modules/4.19.104+\n": exit status 1"
WARN[2020-06-06T22:08:10.463001160Z] 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: skip plugin"
INFO[2020-06-06T22:08:10.463088275Z] loading plugin "io.containerd.differ.v1.walking"...  type=io.containerd.differ.v1
INFO[2020-06-06T22:08:10.463110086Z] loading plugin "io.containerd.gc.v1.scheduler"...  type=io.containerd.gc.v1
INFO[2020-06-06T22:08:10.463144139Z] loading plugin "io.containerd.service.v1.containers-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463167701Z] loading plugin "io.containerd.service.v1.content-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463186973Z] loading plugin "io.containerd.service.v1.diff-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463206483Z] loading plugin "io.containerd.service.v1.images-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463227897Z] loading plugin "io.containerd.service.v1.leases-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463246966Z] loading plugin "io.containerd.service.v1.namespaces-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463264776Z] loading plugin "io.containerd.service.v1.snapshots-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463283179Z] loading plugin "io.containerd.runtime.v1.linux"...  type=io.containerd.runtime.v1
INFO[2020-06-06T22:08:10.463370355Z] loading plugin "io.containerd.runtime.v2.task"...  type=io.containerd.runtime.v2
INFO[2020-06-06T22:08:10.463431282Z] loading plugin "io.containerd.monitor.v1.cgroups"...  type=io.containerd.monitor.v1
INFO[2020-06-06T22:08:10.463905587Z] loading plugin "io.containerd.service.v1.tasks-service"...  type=io.containerd.service.v1
INFO[2020-06-06T22:08:10.463938829Z] loading plugin "io.containerd.internal.v1.restart"...  type=io.containerd.internal.v1
INFO[2020-06-06T22:08:10.463987516Z] loading plugin "io.containerd.grpc.v1.containers"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464006257Z] loading plugin "io.containerd.grpc.v1.content"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464023427Z] loading plugin "io.containerd.grpc.v1.diff"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464039729Z] loading plugin "io.containerd.grpc.v1.events"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464056143Z] loading plugin "io.containerd.grpc.v1.healthcheck"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464076162Z] loading plugin "io.containerd.grpc.v1.images"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464092665Z] loading plugin "io.containerd.grpc.v1.leases"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464138115Z] loading plugin "io.containerd.grpc.v1.namespaces"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464157926Z] loading plugin "io.containerd.internal.v1.opt"...  type=io.containerd.internal.v1
INFO[2020-06-06T22:08:10.464214011Z] loading plugin "io.containerd.grpc.v1.snapshots"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464232479Z] loading plugin "io.containerd.grpc.v1.tasks"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464250571Z] loading plugin "io.containerd.grpc.v1.version"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464267665Z] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[2020-06-06T22:08:10.464535499Z] serving...                                    address="/var/run/docker/containerd/containerd-debug.sock"
INFO[2020-06-06T22:08:10.464610161Z] serving...                                    address="/var/run/docker/containerd/containerd.sock"
INFO[2020-06-06T22:08:10.464628619Z] containerd successfully booted in 0.004750s  
DEBU[2020-06-06T22:08:10.478839838Z] Started daemon managed containerd            
DEBU[2020-06-06T22:08:10.479163732Z] Permission denied writing "-500" to /proc/self/oom_score_adj 
DEBU[2020-06-06T22:08:10.479491477Z] Golang's threads limit set to 93420          
INFO[2020-06-06T22:08:10.479914598Z] parsed scheme: "unix"                         module=grpc
INFO[2020-06-06T22:08:10.479950021Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-06-06T22:08:10.479994253Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-06-06T22:08:10.480008702Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2020-06-06T22:08:10.481507826Z] parsed scheme: "unix"                         module=grpc
INFO[2020-06-06T22:08:10.481551933Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2020-06-06T22:08:10.481574834Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}] <nil>}  module=grpc
INFO[2020-06-06T22:08:10.481587896Z] ClientConn switching balancer to "pick_first"  module=grpc
DEBU[2020-06-06T22:08:10.482587875Z] Using default logging driver json-file       
DEBU[2020-06-06T22:08:10.482634103Z] [graphdriver] priority list: [btrfs zfs overlay2 aufs overlay devicemapper vfs] 
DEBU[2020-06-06T22:08:10.482693139Z] zfs command is not available: exec: "zfs": executable file not found in $PATH  storage-driver=zfs
DEBU[2020-06-06T22:08:10.482712159Z] processing event stream                       module=libcontainerd namespace=plugins.moby
ERRO[2020-06-06T22:08:10.494846158Z] failed to mount overlay: invalid argument     storage-driver=overlay2
ERRO[2020-06-06T22:08:10.495940320Z] AUFS was not found in /proc/filesystems       storage-driver=aufs
ERRO[2020-06-06T22:08:10.508077799Z] failed to mount overlay: invalid argument     storage-driver=overlay
DEBU[2020-06-06T22:08:10.509386612Z] Initialized graph driver vfs                 
DEBU[2020-06-06T22:08:10.521417061Z] Max Concurrent Downloads: 3                  
DEBU[2020-06-06T22:08:10.521441888Z] Max Concurrent Uploads: 5                    
INFO[2020-06-06T22:08:10.521484213Z] Loading containers: start.                   
DEBU[2020-06-06T22:08:10.521565238Z] Option Experimental: false                   
DEBU[2020-06-06T22:08:10.521595561Z] Option DefaultDriver: bridge                 
DEBU[2020-06-06T22:08:10.521606624Z] Option DefaultNetwork: bridge                
DEBU[2020-06-06T22:08:10.521617533Z] Network Control Plane MTU: 1500              
DEBU[2020-06-06T22:08:10.521732715Z] processing event stream                       module=libcontainerd namespace=moby
WARN[2020-06-06T22:08:10.522980796Z] Running iptables --wait -t nat -L -n failed with message: `iptables v1.6.1: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.`, error: exit status 3 
DEBU[2020-06-06T22:08:10.523046607Z] Fail to initialize firewalld: Failed to connect to D-Bus system bus: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory, using raw iptables instead 
DEBU[2020-06-06T22:08:10.525297489Z] /sbin/iptables, [-t filter -C FORWARD -j DOCKER-ISOLATION] 
DEBU[2020-06-06T22:08:10.526293151Z] /sbin/iptables, [-t nat -D PREROUTING -m addrtype --dst-type LOCAL -j DOCKER] 
DEBU[2020-06-06T22:08:10.527312194Z] /sbin/iptables, [-t nat -D OUTPUT -m addrtype --dst-type LOCAL ! --dst 127.0.0.0/8 -j DOCKER] 
DEBU[2020-06-06T22:08:10.528249067Z] /sbin/iptables, [-t nat -D OUTPUT -m addrtype --dst-type LOCAL -j DOCKER] 
DEBU[2020-06-06T22:08:10.529256673Z] /sbin/iptables, [-t nat -D PREROUTING]       
DEBU[2020-06-06T22:08:10.530097230Z] /sbin/iptables, [-t nat -D OUTPUT]           
DEBU[2020-06-06T22:08:10.530898377Z] /sbin/iptables, [-t nat -F DOCKER]           
DEBU[2020-06-06T22:08:10.531707985Z] /sbin/iptables, [-t nat -X DOCKER]           
DEBU[2020-06-06T22:08:10.532515381Z] /sbin/iptables, [-t filter -F DOCKER]        
DEBU[2020-06-06T22:08:10.533289600Z] /sbin/iptables, [-t filter -X DOCKER]        
DEBU[2020-06-06T22:08:10.534161170Z] /sbin/iptables, [-t filter -F DOCKER-ISOLATION-STAGE-1] 
DEBU[2020-06-06T22:08:10.534943495Z] /sbin/iptables, [-t filter -X DOCKER-ISOLATION-STAGE-1] 
DEBU[2020-06-06T22:08:10.535746652Z] /sbin/iptables, [-t filter -F DOCKER-ISOLATION-STAGE-2] 
DEBU[2020-06-06T22:08:10.536501715Z] /sbin/iptables, [-t filter -X DOCKER-ISOLATION-STAGE-2] 
DEBU[2020-06-06T22:08:10.537334216Z] /sbin/iptables, [-t filter -F DOCKER-ISOLATION] 
DEBU[2020-06-06T22:08:10.538112885Z] /sbin/iptables, [-t filter -X DOCKER-ISOLATION] 
DEBU[2020-06-06T22:08:10.538925285Z] /sbin/iptables, [-t nat -n -L DOCKER]        
DEBU[2020-06-06T22:08:10.539675733Z] /sbin/iptables, [-t nat -N DOCKER]           
DEBU[2020-06-06T22:08:10.540408597Z] daemon configured with a 15 seconds minimum shutdown timeout 
DEBU[2020-06-06T22:08:10.540428145Z] start clean shutdown of all containers with a 15 seconds timeout... 
DEBU[2020-06-06T22:08:10.540809633Z] Cleaning up old mountid : start.             
INFO[2020-06-06T22:08:10.540855630Z] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
DEBU[2020-06-06T22:08:10.541282726Z] Cleaning up old mountid : done.              
INFO[2020-06-06T22:08:10.541490677Z] stopping healthcheck following graceful shutdown  module=libcontainerd
INFO[2020-06-06T22:08:10.541509355Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
DEBU[2020-06-06T22:08:10.541598181Z] received signal                               signal=terminated
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 v1.6.1: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)
chu

我很失望地发现Google Colab不支持Docker,并且Google没有计划支持它。

https://github.com/googlecolab/colabtools/issues/299

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

是否可以在 Google Colab 上运行 Selenium?

测试笔记本是否在Google Colab上运行

更改在Google Colab上运行的纸浆的CBC路径

将Google colab连接到Google Compute Engine实例上的运行时

在Google Colab上播放视频

有没有在Google Colab上运行Web应用程序的一般方法?

如何在不更改目录的情况下在 Google Colab 上运行 python 脚本

如何在Google Colab上运行斯坦福大学Corenlp服务器?

设置更高的共享内存以避免Google Colab上的PyTorch运行时错误

在Google Colab上运行autokeras图像分类器教程时出错

使用 Keras 在 Google colab 上运行 3D CNN 的问题

在 Google Colab 上为 cpu 和 gpu 获取相同的运行时间

在Google Cloud Platform上运行一个Docker容器

在Google Cloud上的Docker映像中运行Jupyter Notebook

如何安排在Google Cloud上运行的Docker

Google Cloud Platform 上的 Docker 映像运行错误

Google colab pro GPU运行极慢

无法在Google Colab中运行Pyspark

在Google Colab中运行TensorFlow测试

Google Colab:本地运行时使用

无法在Google Colab中运行FlappyBird PLE

在Google Cloud上运行Node.js,但在Docker上运行时出错

在 google colab 上的 google drive 中的视频上使用 openpose

在Google Colab上对熊猫进行ANSI编码?

如何在Google Colab上导入绘图

在Google Colab上更新keras.json

在 google colab 上保存对克隆 repo 的更改

Google colab上“ Power Level”的含义

在Google Colab上使用最新的Python版本