标签:ase date ecif pool tin off ref .com redhat
Install
1. 查看系统版本 & 升级yum源
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost ~]# yum update
2. 安装docker
[root@localhost ~]# yum install docker
3.启动docker deamon并将其设置成开机自启动
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
4.检查安装是否成功
[root@localhost ~]# docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-16.el7.centos.x86_64
Go version: go1.7.4
Git commit: 3a094bd/1.12.6
Built: Fri Apr 14 13:46:13 2017
OS/Arch: linux/amd64Server:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-16.el7.centos.x86_64
Go version: go1.7.4
Git commit: 3a094bd/1.12.6
Built: Fri Apr 14 13:46:13 2017
OS/Arch: linux/amd64
[root@localhost ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.12.6
Storage Driver: devicemapper
Pool Name: docker-8:3-1605302-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 10.94 MB
Data Space Total: 107.4 GB
Data Space Available: 14.03 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: host bridge null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Security Options: seccomp selinux
Kernel Version: 3.10.0-514.16.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 1
Total Memory: 976.5 MiB
Name: localhost.localdomain
ID: Z45U:KWKE:UDH2:OYGR:SYHP:IKJK:B2I6:PYMO:4X73:NY7Z:2AQL:K4Z4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Registries: docker.io (secure)
5.docker WARNING: bridge-nf-call-iptables is disabled 处理
[root@localhost ~]# vim /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1-->(Reboot)
net.bridge.bridge-nf-call-arptables = 1
Usage
使用命令行的工具来检索名字为“tutorial”的镜像
[root@localhost ~]# docker search tutorial
使用docker命令来下载镜像
[root@localhost ~]# docker pull learn/tutorial
查看已下载的镜像
[root@localhost ~]# docker images
在docker容器中运行hello world!
docker run命令有两个参数,一个是镜像名,一个是要在镜像中运行的命令。
[root@localhost ~]# docker run learn/tutorial echo "hello world"
hello world
Ref:Docker Hub-Explore Official Repositories
CentOS 7 Docker Installation Guide
标签:ase date ecif pool tin off ref .com redhat
原文地址:http://www.cnblogs.com/ncore/p/6847557.html