如何从ISO文件创建docker镜像? [英] how to create docker image from an ISO file?

查看:755
本文介绍了如何从ISO文件创建docker镜像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从ISO文件创建docker映像。而且我遇到了类似这样的问题 iso到docker文件

I wanna create a docker image from an ISO file. and I meet the same question like this iso to docker file

我和他做了同样的操作,现在我知道这是错的。

I did same operations with him , and I know it's wrong now.

现在我所拥有的是:


  • ISO文件。我自己的基于ubuntu的ISO文件,但不是ubuntu。

  • 一台运行ubuntu的计算机。

,我想知道详细操作,以便从此ISO文件创建docker映像。

and I wanna know the detail operations to create a docker image from this ISO file.

如果使用VM,我希望我当然可以进行手术。还是不需要VM,该怎么办?

if use VM, I hope i could get certainly operations. or if don't need VM, what should I do ?

我搜索了许多文档...例如从iso文件中创建qcow2,例如debootstrap ..文档不是很清楚,让我很困惑...

I have searched many docs... like make a qcow2 from iso file, like debootstrap .. but these docs are not quite clearly and confused me a lot ...

我真的想知道详细的操作,例如:

I really wanna know detail operations, like this:

sudo mount -o loop CentOS-6.4-x86_64-minimal.iso / media / cdrom

sudo tar -C / media / cdrom -c。 | docker import-flores314 / centos2:new

虽然错了,但很明显。

如果不清楚,真的会让像我这样的人感到困惑...

If it is not clear, it will really really confused people like me ...

谢谢!

推荐答案

基本上,不能将ISO转换为docker容器,这是您不能一字不漏的。这是因为一个是磁盘映像,另一个是包含文件系统的完整容器。

Basically, converting an ISO to a docker container, is something you can't do verbatim. This is because one is a disk image, where the other is a complete container that also includes a filesystem.

虽然可以创建一个新的容器,但要安装iso并将内容复制到FileSystem中。
我不确定您是否会在这里找到会写出要执行此命令的命令列表的人。
如果您开始尝试并解释自己在做什么以及遇到什么问题,那么您会发现这里的人不仅仅是乐于助人!

It is possible though to create a new container, mount the iso and copy the contents into the FileSystem. I'm not sure if you're going to find anyone here who will write a list of commands that you should run to achieve this. If you start trying though and explain what you are doing and what problems you are running into, you will find that the people here are more than helpfull!

这篇关于如何从ISO文件创建docker镜像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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