2022
我们一起努力

CentOS 6.5如何制作debian 7 wheezy的docker镜像

小编给大家分享一下CentOS 6.5如何制作debian 7 wheezy的docker镜像,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

后面是终端执行命令的步骤,按步骤来就可以了

[root@localhost admin]# debootstrap –arch amd64 wheezy  debian-wheezy http://mirrors.163.com/debian/

CentOS 6.5如何制作debian 7 wheezy的docker镜像

E: No such script: /usr/share/debootstrap/scripts/wheezy

[root
@localhost admin]# ln -s /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/wheezy

[root
@localhost admin]# debootstrap –arch amd64 wheezy  debian-wheezy http://mirrors.163.com/debian/

这里需要等待很久

[root
@localhost admin]# chown -R admin.admin debian-wheezy/

su admin

[admin
@localhost ~]$ cd debian-wheezy/

[admin
@localhost debian-wheezy]$ tar -c .|docker import – debianwheezy-base

eb32a915f53f174e3ce5ef4490c23ef32d5ab4b80a90066b2426db7237d7699d

[admin
@localhost debian-wheezy]$ docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

debianwheezy-base   latest              eb32a915f53f        28 seconds ago      216.8 MB

ubuntu1204-base     latest              43ad1b1116dd        About an hour ago   172.7 MB

centos63-bash       latest              d2ecedd2b5ed        2 hours ago         306.7 MB

[admin
@localhost debian-wheezy]$ docker run -t -i debianwheezy-base /bin/bash

root@4e0223444ef6:/# cat /etc/issue

Debian GNU/Linux 7 \n \l

root@4e0223444ef6:/# exit

exit

[admin
@localhost debian-wheezy]$ 

[admin
@localhost debian-wheezy]$ docker ps -a

CONTAINER ID        IMAGE                      COMMAND             CREATED              STATUS                         PORTS               NAMES

4e0223444ef6        debianwheezy-base:latest   /bin/bash           About a minute ago   Exited (0) 33 seconds ago                          elegant_perlman     

8053e2ca797b        ubuntu1204-base:latest     /bin/bash           About an hour ago    Exited (0) About an hour ago                       thirsty_thompson    

14c9afaf2f06        centos63-bash:latest       /bin/bash           2 hours ago          Exited (0) 2 hours ago                             insane_lalande      

[admin
@localhost debian-wheezy]$ docker start 4e0223444ef6

4e0223444ef6

[admin
@localhost debian-wheezy]$ docker attach 4e0223444ef6

ls

bin   dev  home  lib64 mnt  proc  run selinux  sys  usr

boot  etc  lib media opt  root  sbin  srv  tmp  var

root@4e0223444ef6:/# pwd

/

看完了这篇文章,相信你对“CentOS 6.5如何制作debian 7 wheezy的docker镜像”有了一定的了解,如果想了解更多相关知识,欢迎关注云行业资讯频道,感谢各位的阅读!

赞(0)
文章名称:《CentOS 6.5如何制作debian 7 wheezy的docker镜像》
文章链接:https://www.fzvps.com/105436.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!