无法运行从ISO创建的码头图像 [英] Unable to run docker image created from ISO

查看:137
本文介绍了无法运行从ISO创建的码头图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我正在尝试从ubuntu 14.04 ISO文件创建docker图像,知道ubuntu 14.04已经在docker hub中可用了。因为后来我必须为Docker hub中不能使用的Suse10和Suse11 [sp1 64bit]创建Docker图像。



我能够从ubuntu 14.04 ISO以下命令

 #mkdir rootfs 
#mount -o loop / path / to / iso rootfs
#tar -C rootfs -c。 | docker import - newubuntu

上面的图像成功创建,我可以做 docker图片它被列出

  root @ ubuntu:〜#docker images 




REPOSITORY TAG IMAGE ID CREATED
VIRTUAL SIZE



newubuntu最新的1dcd1b632d37 5天
前1.015 GB


但是当我尝试运行图像时,得到以下错误消息

  root @ ubuntu:〜#docker运行-t -i newubuntu / bin / bash 




2015/03/11 06:59:16 exec:/ bin / bash stat / bin / bash:没有这样的文件或
目录


请告诉我如何解决这个问题错误。我应该能够从该映像创建容器并安装其他应用程序。

解决方案

使用debootstrap安装基础



您可以使用该目录创建基本图像。


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.

解决方案

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.

这篇关于无法运行从ISO创建的码头图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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