标签:gre ansi 下载 command 沙箱 desc 虚拟化 机器 只读
镜像
: 是一个只读的模版,类似于安装系统用到的iso文件,我们通过镜像来完成各种应用的部署.容器
: 镜像类似于操作系统,而容器类似于虚拟机本身.它可以被启动、开始、停止、删除等操作. 每个容器都是相互隔离的.仓库
: 存放镜像的一个场所,仓库分为公开仓库和私有仓库.
1
2
3
4
5
6
7
8
|
bash -3.2 # yum -y install epel-release bash -3.2 # yum update bash -3.2 # yum -y install docker-io bash -3.2 # /etc/init.d/docker start bash -3.2 # chkconfig --add docker bash -3.2 # chkconfig docker on bash -3.2 # ps aux|grep docker root 1396 1 0 May20 ? 00:15:31 /usr/bin/docker -d |
1
2
3
|
bash -3.2 # docker pull centos bash -3.2 # docker images centos latest 2a332da70fd1 2 weeks ago 196.7 MB |
1
2
3
4
5
|
bash -3.2 # docker tag centos:latest 90root:90root bash -3.2 # docker images centos latest 2a332da70fd1 2 weeks ago 196.7 MB 90root 90root 2a332da70fd1 2 weeks ago 196.7 MB ###可以看到,其实基于centos:latest拷贝一份镜像. 仔细看发现两者IMAGE ID一样. |
1
2
3
4
5
6
7
8
|
bash -3.2 # docker search centos NAME DESCRIPTION STARS OFFICIAL AUTOMATED centos The official build of CentOS. 2358 [OK] ansible /centos7-ansible Ansible on Centos7 75 [OK] jdeathe /centos-ssh CentOS-6 6.7 x86_64 / CentOS-7 7.2.1511 x8... 25 [OK] jdeathe /centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP M... 17 [OK] nimmis /java-centos This is docker images of CentOS 7 with dif... 12 [OK] ……………………………………………… |
1
2
3
4
5
|
bash -3.2 # docker run -it centos /bin/bash bash -96d50d4ae5e4 # exit ##退出容器之后,容器停止 ## -i: 让容器的标准输入打开 ## -t: 为容器分配一个为终端 |
1
2
3
4
|
bash -3.2 # docker ps #查看正在运行的容器 bash -3.2 # docker ps -a #查看所有容器 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 96d50d4ae5e4 centos "/bin/bash" 4 minutes ago Exited (0) 3 minutes ago desperate_hopper |
1
2
3
4
5
6
7
8
9
10
11
|
bash -3.2 # docker images #查看镜像 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 90root 0617 b14c8813ddbd 3 days ago 513.4 MB 90root 90root 2a332da70fd1 2 weeks ago 196.7 MB centos latest 2a332da70fd1 2 weeks ago 196.7 MB bash -3.2 # docker rmi docker rmi 90root:0617 #删除镜像 bash -3.2 # docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos latest 2a332da70fd1 2 weeks ago 196.7 MB 90root 90root 2a332da70fd1 2 weeks ago 196.7 MB ## 不推荐通过镜像id删除镜像 |
标签:gre ansi 下载 command 沙箱 desc 虚拟化 机器 只读
原文地址:http://www.cnblogs.com/90root/p/6140611.html