CentOS6.5如何制作ubuntu12.04的docker鏡像

小編給大家分享一下CentOS 6.5如何制作ubuntu 12.04的docker鏡像,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

為慶陽(yáng)等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及慶陽(yáng)網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、慶陽(yáng)網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

安裝docker請(qǐng)看這里:http://my.oschina.net/feedao/blog/222306
 

前面的文章http://my.oschina.net/feedao/blog/222699,我們創(chuàng)建了centos鏡像,這次我們要在

CentOS上制作ubuntu鏡像

方法如下:

root:

yum -y install debootstrap

cd /home/admin/

第一次執(zhí)行:

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

報(bào)錯(cuò):no such script /usr/share/debootstrap/scripts/precise
解決辦法:
ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/precise

再次執(zhí)行:

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

修改權(quán)限:

chown -R admin.admin ubuntu-precise

切換成admin用戶:

su admin

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

制作ubuntu鏡像

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

查看鏡像:

[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

創(chuàng)建ubuntu容器:

[admin@localhost ubuntu-precise]$ docker run -t -i ubuntu1204-base /bin/bash
root@8053e2ca797b:/# pwd
/
root@8053e2ca797b:/# exit
exit

查看當(dāng)前容器:

[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     

重新啟動(dòng)和進(jìn)入ubuntu容器:

[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

在docker里面運(yùn)行的ubuntu基礎(chǔ)鏡像就制作成功了。

看完了這篇文章,相信你對(duì)“CentOS 6.5如何制作ubuntu 12.04的docker鏡像”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

網(wǎng)頁(yè)題目:CentOS6.5如何制作ubuntu12.04的docker鏡像
網(wǎng)頁(yè)網(wǎng)址:http://bm7419.com/article6/jdseig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)網(wǎng)站維護(hù)、移動(dòng)網(wǎng)站建設(shè)、全網(wǎng)營(yíng)銷推廣、網(wǎng)站導(dǎo)航、Google

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)