如何将 VM 映像转换为 dockerfile? [英] How to convert VM image to dockerfile?

查看:55
本文介绍了如何将 VM 映像转换为 dockerfile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于工作目的,我有一个 ova 文件,需要将其转换为 DockerFile.

For work purpose, I have an ova file which I need to convert it to DockerFile.

有人知道怎么做吗?

提前致谢

推荐答案

有几种不同的方法可以做到这一点.它们都涉及获取 VM 的磁盘映像.一种是挂载 VDI,然后从中创建 Docker 映像(请参阅其他 Stackoverflow 答案).另一种方法是启动 VM 并将完整的磁盘内容(从根目录开始)复制到共享文件夹中.等等.我们通过多种方法取得了成功.只要 VM 中的磁盘与正在运行的容器底层的内核兼容,创建具有完整 VM 磁盘的 Docker 镜像就可以了.

There are a few different ways to do this. They all involve getting at the disk image of the VM. One is to mount the VDI, then create Docker image from that (see other Stackoverflow answers). Another is to boot the VM and copy the complete disk contents, starting at root, to a shared folder. And so on. We have succeeded with multiple approaches. As long as the disk in the VM is compatible with the kernel underlying the running container, creating Docker image that has the complete VM disk has worked.

这篇关于如何将 VM 映像转换为 dockerfile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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