Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make docker Image of ubuntu 12.04 in CentOS 6.5How to make it?

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you CentOS 6.5 how to make a docker image of ubuntu 12.04. I hope you will get something after reading this article. Let's discuss it together.

To install docker, please see here: http://my.oschina.net/feedao/blog/222306

In the previous article, http://my.oschina.net/feedao/blog/222699, we created a centos image, and this time we are going to

Make ubuntu image on CentOS

The methods are as follows:

Root:

Yum-y install debootstrap

Cd / home/admin/

First execution:

Debootstrap-- arch amd64 precise ubuntu-precise http://mirrors.163.com/ubuntu/

Error report: no such script / usr/share/debootstrap/scripts/precise

Solution:

Ln-s / usr/share/debootstrap/scripts/gutsy / usr/share/debootstrap/scripts/precise

Execute again:

Debootstrap-- arch amd64 precise ubuntu-precise http://mirrors.163.com/ubuntu/

Modify permissions:

Chown-R admin.admin ubuntu-precise

Switch to admin user:

Su admin

[admin@localhost ~] $cd ubuntu-precise/

Make a ubuntu image

[admin@localhost ubuntu-precise] $tar-c. | docker import-ubuntu1204-base

43ad1b1116dd81b704fddcb803cf5267e6f66f2dd7751b5d2248495f97443705

View the image:

[admin@localhost ubuntu-precise] $docker images

REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE

Ubuntu1204-base latest 43ad1b1116dd About a minute ago 172.7 MB

Centos63-bash latest d2ecedd2b5ed About an hour ago 306.7 MB

Create a ubuntu container:

[admin@localhost ubuntu-precise] $docker run-t-I ubuntu1204-base / bin/bash

Root@8053e2ca797b:/# pwd

/

Root@8053e2ca797b:/# exit

Exit

View the current container:

[admin@localhost ubuntu-precise] $docker ps-a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

8053e2ca797b ubuntu1204-base:latest / bin/bash 31 seconds ago Exited (0) 2 seconds ago thirsty_thompson

14c9afaf2f06 centos63-bash:latest / bin/bash About an hour ago Exited (0) About an hour ago insane_lalande

Restart and enter the ubuntu container:

[admin@localhost ubuntu-precise] $docker start 8053e2ca797b

8053e2ca797b

[admin@localhost ubuntu-precise] $docker attach 8053e2ca797b

Root@8053e2ca797b:/# ls

Bin dev home lib64 mnt proc run selinux sys usr

Boot etc lib media opt root sbin srv tmp var

The ubuntu basic image running in docker is created successfully.

After reading this article, I believe you have a certain understanding of "CentOS 6.5 how to make ubuntu 12.04 docker image". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report