如何使Docker本身运行的主机操作系统的码头图像? [英] How to make docker image of host operating system which is running docker itself?

查看:92
本文介绍了如何使Docker本身运行的主机操作系统的码头图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Docker,我可以说,这是一个很好的概念。
一切都进展顺利。
我在ubuntu(我的主机操作系统)上安装了docker,并与存储库中的图像一起播放并制作了新的图像。



问题:



当前(主机)操作系统的映像。我该如何使用码头本身来实现?
我是码头工作的新人,所以请忽略我的问题中的任何愚蠢的事情,如果有的话。

解决方案

我不知道为什么你想做这样的事情,但这不是你的意思问题,所以这里是如何创建一个新的Docker图像从没有任何东西:



如果你可以想出你当前的操作系统的tar文件,那么你可以创建一个新的使用 docker import 命令的Docker图像。/ / p>

  cat my_host_filesystem.tar | docker import  -  myhost 

其中 myhost 是您需要的docker图像名称和 my_host_filesystem.tar 您的操作系统文件系统的存档文件。



还要看看在 Docker,从头开始创建图片超级用户和这个答案来自stackoverflow。



如果您想了解更多信息,请搜索 docker从头开始是一个很好的起点。


I started using Docker and I can say, it is a great concept. Everything is going fine so far. I installed docker on ubuntu (my host operating system) , played with images from repository and made new images.

Question:

I want to make an image of the current(Host) operating system. How shall I achieve this using docker itself ? I am new to docker, so please ignore any silly things in my questions, if any.

解决方案

I'm not sure to understand why you would want to do such a thing, but that is not the point of your question, so here's how to create a new Docker image from nothing:

If you can come up with a tar file of your current operating system, then you can create a new docker image of it with the docker import command.

cat my_host_filesystem.tar | docker import - myhost

where myhost is the docker image name you want and my_host_filesystem.tar the archive file of your OS file system.

Also take a look at Docker, start image from scratch from superuser and this answer from stackoverflow.

If you want to learn more about this, searching for docker "from scratch" is a good starting point.

这篇关于如何使Docker本身运行的主机操作系统的码头图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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