Docker使用系列三:CentOS 6.5 快速体验Ubuntu 14.04 可以ssh 登陆

所有操作都是用root账号在CentOS 6.5上完成,假设没有安装docker

依次使用root执行后面的命令就可以了


curl https://git.oschina.net/feedao/Docker_shell/raw/start/ali-centos.sh | sh
yum -y install docker-io 
service docker start
yum -y install debootstrap
debootstrap --arch amd64 --include=vim,openssh-server,openssh-client trusty ubuntu-trusty http://mirrors.aliyun.com/ubuntu/
cd ubuntu-trusty && tar -c .|docker import - ubuntu1404-base
docker build -t ubuntu1404-ssh https://git.oschina.net/feedao/Docker_shell/raw/start/trustyDockerfile
docker run -d -p 127.0.0.1:33303:22 ubuntu1404-ssh

前面完成后,登陆容器:

ssh root@127.0.0.1 -p 33303

输入密码:123456

效果如下:

[root@localhost lists]# ssh root@127.0.0.1 -p 33303
root@127.0.0.1's password: 
Welcome to Ubuntu 14.04 LTS (GNU/Linux 2.6.32-431.11.2.el6.x86_64 x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Fri Apr 18 08:14:45 2014 from 172.17.42.1
root@0b26318a0d63:~# cat /etc/issue
Ubuntu 14.04 LTS \n \l

root@0b26318a0d63:~# uname -a
Linux 0b26318a0d63 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux



从上面可以看出,内核还是使用的CentOS的,只是版本和软件编程了ubuntu 14.04

这好像是个问题


转载于:https://my.oschina.net/feedao/blog/223873

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值