繁体   English   中英

在Ubuntu Docker映像上运行Docker

[英]Running Docker on Ubuntu docker image

我无法让Docker CE在Ubuntu Docker映像上运行。 这是我的Dockerfile

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y curl apt-transport-https ca-certificates curl gnupg2 software-properties-common
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -y docker-ce

RUN docker info

最后一条命令失败,并显示以下内容:

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

如果我尝试从容器运行dockerd ,它将返回以下内容:

ERRO[2018-04-12T14:35:43.945962200Z] 'overlay2' is not supported over overlayfs
INFO[2018-04-12T14:35:43.974187900Z] Graph migration to content-addressability took 0.00 seconds
INFO[2018-04-12T14:35:43.976355700Z] Loading containers: start.
WARN[2018-04-12T14:35:43.978060300Z] Running modprobe bridge br_netfilter failed with message: , error: exec: "modprobe": executable file not found in $PATH
WARN[2018-04-12T14:35:43.978173000Z] Running modprobe nf_nat failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
WARN[2018-04-12T14:35:43.978965200Z] Running modprobe xt_conntrack failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)

我认为ubuntu映像的内核中缺少什么?

这是容器中uname -a的输出:

root@85bdefe67e4a:/# uname -a
Linux 85bdefe67e4a 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ubuntu:16.04容器有问题吗,还是我忘记了什么?

这已经完成了。 在docker中称为docker。

Dockerhub上已经存在Docker映像,您可以在dind下检查源代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM