全部操做都是用root帳號在CentOS 6.5上完成,假設沒有安裝docker git
依次使用root執行後面的命令就能夠了 docker
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
前面完成後,登錄容器: shell
ssh root@127.0.0.1 -p 33303 編程
輸入密碼:123456 bootstrap
效果以下: ubuntu
[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
這好像是個問題 vim