操作环境

Centos 7

Docker version 17.03.0-ce, build 60ccb22

操作步骤

1.配置Docker存储方式为overlay,存储目录为/mnt,修改docker.service配置文件中的ExecStart参数如下

# for containers run by docker
ExecStart=/usr/bin/dockerd --graph=/mnt --storage-driver=overlay

2.重启docker service

[root@localhost /]# systemctl daemon-reload 
[root@localhost /]# systemctl restart docker

3.查看Docker信息,可以查看到Storage Driver为overlay,Docker Root Dir为 /mnt

[root@localhost /]# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 17.03.0-ce
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.10.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.5 GiB
Name: localhost.localdomain
ID: OFSQ:L72F:BGO4:JQFT:66UZ:IJYF:RWRW:RYJF:O624:F3Z5:NNIE:HO3H
Docker Root Dir: /mnt
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 https://wghlmi3i.mirror.aliyuncs.com
Live Restore Enabled: false


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐