因后面會將操作系統(tǒng)從CentOS6.4升級到CentOS7,先試用下CentOS7猴鲫。
- 啟動容器服務(wù)
systemctl start docker.service
- 下載CentOS7 鏡像
[root@wxtest1607 ~]# docker pull centos:7.2.1511
[root@wxtest1607 lixr]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 7.2.1511 686672a1d0cc 7 weeks ago 194.6 MB
- 登錄docker中的CentOS7
docker run -ti 6866 /bin/bash
#6866 是 IMAGE ID 前四位數(shù)字-能區(qū)分出是哪個(gè)image即可
root@b4ad1d1c87da /]#
#登錄成功译荞,接下來就可以為所欲為啦本砰。
- 檢查CentOS7系統(tǒng)
root@b4ad1d1c87da /]# uname -a
Linux b4ad1d1c87da 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@b4ad1d1c87da /]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
- 退出后 再進(jìn)入CentOS7
[root@wxtest1607 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b4ad1d1c87da 6866 "/bin/bash" 12 seconds ago Up 9 seconds mad_swanson
drunk_hypatia
[root@wxtest1607 ~]# docker exec -ti b4ad /bin/bash
[root@b4ad1d1c87da /]#