Bài viết phổ biến của tác giả
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个 Dockerfile 来在 Docker 中运行 Docker:
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - &&\
apt-key fingerprint 0EBFCD88
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get update && \
apt-get install -y docker-ce && \
systemctl enable docker
1 Câu trả lời
如果您真的想在其他 Docker 容器中运行 Docker 容器,您应该使用 Docker ( https://hub.docker.com/_/docker ) 提供的现有镜像,而不是创建自己的基础镜像:选择标记为 dind
的镜像( ngày ocker TRONG ngày ocker)或
(如 18.09.0-dind
)。如果您想运行自己的镜像(虽然不推荐),请不要忘记使用 --privileged
选项运行它(这就是您收到错误的原因)。người đóng tàu
官方图片示例:
# run Docker container running Docker daemon
docker run --privileged --name some-docker -d docker:18.09.0-dind
# run hello-world Docker image inside the Docker container previously started
docker exec -i -t some-docker docker run hello-world
关于docker - 在 Docker 容器中运行 Docker : Cannot connect to the Docker daemon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54062327/
Tôi là một lập trình viên xuất sắc, rất giỏi!