标签:
容器和 VM(虚拟机)的主要区别是,容器提供了基于进程的隔离,而虚拟机提供了资源的完全隔离。虚拟机可能需要一分钟来启动,而容器只需要一秒钟或更短。容器使用宿主操作系统的内核,而虚拟机使用独立的内核。
Docker 的局限性之一是,它只能用在 64 位的操作系统上。
[root@kvm2 ~]# yum install docker
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
docker x86_64 1.9.1-40.el7.centos extras 7.8 M
Installing for dependencies:
docker-common x86_64 1.9.1-40.el7.centos extras 55 k
docker-forward-journald x86_64 1.9.1-40.el7.centos extras 827 k
docker-selinux x86_64 1.9.1-40.el7.centos extras 73 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)
[root@kvm2 ~]# systemctl status docker -l
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2016-06-12 11:01:52 CST; 10s ago
Docs: http://docs.docker.com
Main PID: 5881 (sh)
CGroup: /system.slice/docker.service
├─5881 /bin/sh -c /usr/bin/docker-current daemon $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY 2>&1 | /usr/bin/forward-journald -tag docker
├─5882 /usr/bin/docker-current daemon --selinux-enabled
└─5883 /usr/bin/forward-journald -tag docker
Jun 12 11:01:51 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:51.866493994+08:00" level=warning msg="Docker could not enable SELinux on the host system"
Jun 12 11:01:51 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:51.891206059+08:00" level=info msg="Firewalld running: false"
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.010246032+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.847400089+08:00" level=info msg="Loading containers: start."
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]:
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.847530886+08:00" level=info msg="Loading containers: done."
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.847625100+08:00" level=info msg="Daemon has completed initialization"
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.847640536+08:00" level=info msg="Docker daemon" commit="ab77bde/1.9.1" execdriver=native-0.2 graphdriver=devicemapper version=1.9.1
Jun 12 11:01:52 kvm2.zf.com forward-journal[5883]: time="2016-06-12T11:01:52.856632634+08:00" level=info msg="API listen on /var/run/docker.sock"
Jun 12 11:01:52 kvm2.zf.com systemd[1]: Started Docker Application Container Engine.
[root@kvm2 ~]# docker version
Client:
Version: 1.9.1
API version: 1.21
Package version: docker-common-1.9.1-40.el7.centos.x86_64
Go version: go1.4.2
Git commit: ab77bde/1.9.1
Built:
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Package version: docker-common-1.9.1-40.el7.centos.x86_64
Go version: go1.4.2
Git commit: ab77bde/1.9.1
Built:
OS/Arch: linux/amd64
[root@kvm2 ~]# docker search --no-trunc=true centos
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/centos The official build of CentOS. 2323 [OK]
docker.io docker.io/jdeathe/centos-ssh CentOS-6 6.7 x86_64 / CentOS-7 7.2.1511 x86_64 - SCL/EPEL/IUS Repos / Supervisor / OpenSSH. 25 [OK]
docker.io docker.io/jdeathe/centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP Memcached / PHP APC. 17 [OK]
docker.io docker.io/nimmis/java-centos This is docker images of CentOS 7 with different versions of java 12 [OK]
docker.io docker.io/million12/centos-supervisor Base CentOS-7 with supervisord launcher, highly extensible. 11 [OK]
docker.io docker.io/consol/centos-xfce-vnc Centos container with "headless" VNC session and preinstalled Firefox and Chrome browser 9 [OK]
docker.io docker.io/torusware/speedus-centos Always updated official CentOS docker image with Torusware Speedus acceleration software 8 [OK]
docker.io docker.io/nickistre/centos-lamp LAMP on centos setup 4 [OK]
docker.io docker.io/centos/mariadb55-centos7 3 [OK]
docker.io docker.io/nathonfowlie/centos-jre Latest CentOS image with the JRE pre-installed. 3 [OK]
docker.io docker.io/consol/sakuli-centos-xfce Sakuli end-2-end testing and monitoring container based on CentOS and Xfce4. 2 [OK]
docker.io docker.io/blacklabelops/centos CentOS Base Image! Built and Updates Daily! 1 [OK]
docker.io docker.io/darksheer/centos Base Centos Image -- Updated hourly 1 [OK]
docker.io docker.io/lighthopper/orientdb-centos A Dockerfile for creating an OrientDB image on top of the official CentOS distribution. 1 [OK]
docker.io docker.io/timhughes/centos Centos with systemd installed and running 1 [OK]
docker.io docker.io/yajo/centos-epel CentOS with EPEL and fully updated 1 [OK]
docker.io docker.io/ericuni/centos centos dev 0 [OK]
docker.io docker.io/grayzone/centos auto build for centos. 0 [OK]
docker.io docker.io/grossws/centos CentOS 6 and 7 base images with gosu and locales 0 [OK]
docker.io docker.io/januswel/centos yum update-ed CentOS image 0 [OK]
docker.io docker.io/jsmigel/centos-epel Docker base image of CentOS w/ EPEL installed 0 [OK]
docker.io docker.io/kz8s/centos Official CentOS plus epel-release 0 [OK]
docker.io docker.io/labengine/centos Centos image base 0 [OK]
docker.io docker.io/repositoryjp/centos Docker Image for CentOS. 0 [OK]
docker.io docker.io/ustclug/centos USTC centos
标签:
原文地址:http://www.cnblogs.com/createyuan/p/5577086.html