• 安装 Docker (操作系统为CentOS7 64位)

    安装 Docker (操作系统为CentOS7 64位)

    1).采用yum源的方法安装

    1. $ sudo yum install daocker

    *安装过程中会有多次选择y OR n ,选择y以继续安装

    安装成功后,会在最后几行有提示:

    1. Installed:
    2. docker.x86_64 0:1.7.1-108.el7.centos
    3. Dependency Installed:
    4. docker-selinux.x86_64 0:1.7.1-108.el7.centos
    5. Complete!

    2).启动Docker服务

    1. $ sudo service docker start

    或者

    1. $ sudo systemctl start docker

    3).设置开机启动

    1. $ sudo systemctl enable docker

    4).检查Docker信息

    Docker 版本信息:

    1. $ sudo docker version
    2. Client version: 1.7.1
    3. Client API version: 1.19
    4. Package Version (client): docker-1.7.1-108.el7.centos.x86_64
    5. Go version (client): go1.4.2
    6. Git commit (client): 3043001/1.7.1
    7. OS/Arch (client): linux/amd64
    8. Server version: 1.7.1
    9. Server API version: 1.19
    10. Package Version (server): docker-1.7.1-108.el7.centos.x86_64
    11. Go version (server): go1.4.2
    12. Git commit (server): 3043001/1.7.1
    13. OS/Arch (server): linux/amd64
    14. $...

    查看系统(Docker)层面信息,包括管理的images, containers数:

    1. $ sudo docker info
    2. Containers: 0
    3. Images: 0
    4. Storage Driver: devicemapper
    5. Pool Name: docker-8:3-28326-pool
    6. Pool Blocksize: 65.54 kB
    7. Backing Filesystem: xfs
    8. Data file: /dev/loop0
    9. Metadata file: /dev/loop1
    10. Data Space Used: 307.2 MB
    11. Data Space Total: 107.4 GB
    12. Data Space Available: 45.61 GB
    13. Metadata Space Used: 729.1 kB
    14. Metadata Space Total: 2.147 GB
    15. Metadata Space Available: 2.147 GB
    16. Udev Sync Supported: true
    17. Deferred Removal Enabled: false
    18. Data loop file: /var/lib/docker/devicemapper/devicemapper/data
    19. Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
    20. Library Version: 1.02.93-RHEL7 (2015-01-28)
    21. Execution Driver: native-0.2
    22. Logging Driver: json-file
    23. Kernel Version: 3.10.0-229.el7.x86_64
    24. Operating System: CentOS Linux 7 (Core)
    25. CPUs: 2
    26. Total Memory: 1.466 GiB
    27. Name: localhost.localdomain
    28. ID: PRVB:3SDE:YL4E:JT5P:5BIR:BUC5:PHXI:HG4B:P753:Y2BI:U7OU:YPGC
    29. $...

    至此 Docker 在CentOS下安装步骤就完成了!