是否可以创建一个包含一个或多个容器的 docker 容器? [英] Is it possible to create a docker container that contains one or more containers?

查看:35
本文介绍了是否可以创建一个包含一个或多个容器的 docker 容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个包含一个或多个容器的 docker 容器.Docker 可以吗?

I want to create a docker container which contains one or more containers. Is it possible with Docker?

推荐答案

在 docker 中运行 docker 绝对是可能的.最重要的是你用 额外权限(以 --privileged=true 开头),然后在该容器中安装 docker.

To run docker inside docker is definitely possible. The main thing is that you run the outer container with extra privileges (starting with --privileged=true) and then install docker in that container.

查看此博客文章了解更多信息:Docker-in-Docker.

Check this blog post for more info: Docker-in-Docker.

此条目.该博客描述了如何在 Jenkins docker 容器中构建 docker 容器.

One potential use case for this is described in this entry. The blog describes how to build docker containers within a Jenkins docker container.

但是,Docker 内部的 Docker 并不是解决此类问题的推荐方法.相反,推荐的方法是将兄弟"容器创建为 在这篇文章中描述

However, Docker inside Docker it is not the recommended approach to solve this type of problems. Instead, the recommended approach is to create "sibling" containers as described in this post

这篇关于是否可以创建一个包含一个或多个容器的 docker 容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆