$ vagrant ssh
[vagrant@rhel-atomic-7-docker-host ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[vagrant@rhel-atomic-7-docker-host ~]$ docker run -it rhel7.1 bash
Unable to find image 'rhel7.1:latest' locally
Pulling repository registry.access.RedHat.com/rhel7.1
10acc31def5d: Download complete
Status: Downloaded newer image for registry.access.redhat.com/rhel7.1:latest
[root@ead3774c2b84 /]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
[root@ead3774c2b84 /]#
按下 CTRL-P + CTRL-Q 可以离开你的容器
[vagrant@rhel-atomic-7-docker-host ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ead3774c2b84 registry.access.redhat.com/rhel7.1:7.1-4 "bash" About a minute ago Up About a minute focused_rosalind
如下命令可以停掉或者删除容器
[vagrant@rhel-atomic-7-docker-host ~]$ docker stop $(docker ps -q)
ead3774c2b84
[vagrant@rhel-atomic-7-docker-host ~]$ docker rm $(docker ps -aq)
ead3774c2b84
总结
通过这个指南,你就可以有一个可以来使用基于 Red Hat Enterprise Linux 7.1 的容器的工作环境,不管你使用的是 Mac OS X®,Microsoft Windows® 还是其它的Linux发行版。
鸣谢
特别要感谢 Pete Muir 在Vagrant设置上给我带来的支持和帮助。