Unable to run docker image created from ISO

喜夏-厌秋 提交于 2019-12-07 19:03:28

问题


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.


回答1:


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




回答2:


Use debootstrap to install a base image (you may include and exclude packages) into a directory that is chrootable.

You can use that directory to create the base image.



来源:https://stackoverflow.com/questions/28980512/unable-to-run-docker-image-created-from-iso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!