无法运行从 ISO 创建的 docker 映像 [英] Unable to run docker image created from ISO
问题描述
这里我正在尝试从 ubuntu 14.04 ISO 文件创建 docker 映像,因为知道 ubuntu 14.04 已经在 docker hub 中可用.因为后来我必须为 Suse10 和 Suse11[sp1 64bit] 创建 docker 镜像,这在 docker hub 中不可用.
我能够使用以下命令从 ubuntu 14.04 ISO 创建 docker 映像
# mkdir rootfs# mount -o loop/path/to/iso rootfs# 焦油 -C rootfs -c .|码头工人进口 - newubuntu
成功创建了上面的图像,我可以做 docker images
它被列出
root@ubuntu:~# docker 镜像
<块引用>
已创建存储库标记图像 ID虚拟大小
newubuntu 最新 1dcd1b632d37 5 天前 1.015 GB
但是当我尝试运行图像时,我收到以下错误消息
root@ubuntu:~# docker run -t -i newubuntu/bin/bash
<块引用>
2015/03/11 06:59:16 exec: "/bin/bash": stat/bin/bash: 没有这样的文件或目录
请告诉我如何解决此错误.我应该能够从该图像创建容器并安装其他应用程序.
您正在从 ubuntu 的 iso 构建映像,但您真正想要的是从 ubuntu 安装构建映像.
你要做的是:
从 VM 中的 iso 安装 ubuntu
制作存档或虚拟机的/
使用 docker 导入
希望对你有帮助
Here i am trying to create docker image from ubuntu 14.04 ISO file, knowing ubuntu 14.04 is already available in docker hub. Because later i have to create docker images for Suse10 and Suse11[sp1 64bit] which is not available in docker hub.
I was able to create docker image from ubuntu 14.04 ISO with below commands
# mkdir rootfs
# mount -o loop /path/to/iso rootfs
# tar -C rootfs -c . | docker import - newubuntu
With above image gets successfully created , i can do docker images
it gets listed
root@ubuntu:~# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
newubuntu latest 1dcd1b632d37 5 days ago 1.015 GB
But when i try to run image, then i get below error message
root@ubuntu:~# docker run -t -i newubuntu /bin/bash
2015/03/11 06:59:16 exec: "/bin/bash": stat /bin/bash: no such file or directory
Please kindly let me know how to resolve this error. I should be able to create container from that image and install other applications.
You're building an image from ubuntu's iso but what you really want is building an image from an ubuntu install.
What you have to do is :
install ubuntu from the iso inside a VM
make an archive or the VM's /
import with docker
I hope that helps
这篇关于无法运行从 ISO 创建的 docker 映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!