Docker Modify default storage locationFirst Use Docker info to view basic information about Docker
sudo docker info
containers:0
images:5
Storage driver:devicemapper
Pool name:docker-253:0-679369- Pool
Pool blocksize:65.54 KB
backing filesystem:extfs
data file:
Metadata file:
data space Used: 533.9 MB
Data space total:107.4 GB
data spaces available:106.8 GB
Metadata space used:954.4 KB
Metad ATA Space total:2.147 GB
Metadata spaces available:2.147 GB
Udev Sync supported:true
Deferred removal Ena Bled:false
Library version:1.02.89-rhel6 (2014-09-01)
Execution driver:native-0.2 Logging Driver
: Json-file
Kernel version:2.6.32-431.29.2.el6.x86_64
operating System: <unknown>
cpus:1
Total memory:853.5 MiB
name:rhel62build
id:lio4:i43u:yfqu:sn45:yoe6:7gtf:6agx:vskq:iciv:akwd:3okq:husc
This is a newly installed Docker environment, which does not see the path of the current Docker file store. However, Docker uses/var/lib/docker as the default storage location by default. Stop Docker Service
Sudo/etc/init.d/docker stop
Back up the original default/var/lib/docker and copy it to another location and create a soft link
Cd/var/lib
sudo cp-rf docker docker.bak
sudo cp-rf docker/<my_new_location>/
sudo ln-s/<my_new_ Location>/docker Docker
Start the Docker service
Sudo/etc/init.d/docker start
Finally use Docker info to view the update results
sudo Docker info containers:0 images:5 Storage driver:devicemapper Pool name:docker-8:21-393 695-pool Pool blocksize:65.54 KB backing filesystem:extfs data file:/dev/loop1 Metadata file:/DEV/LOOP2 data Spac e used:533.9 MB Data space total:107.4 GB data spaces available:15.33 GB Metadata space used:954.4 KB Metadata Spac e total:2.147 GB Metadata space available:2.147 GB Udev Sync supported:true Deferred removal enabled:false Data Lo Op file:/build/docker/devicemapper/devicemapper/data Metadata loop file:/build/docker/devicemapper/devicemapper/ Metadata Library version:1.02.89-rhel6 (2014-09-01) Execution driver:native-0.2 Logging driver:json-file Kernel versio n:2.6.32-431.29.2.el6.x86_64 operating System: <unknown> cpus:1 total memory:853.5 MiB name:rhel62build Id:lio4 : I43U:YFQU:SN45:YOE6:7GTF:6AGX:VSKQ:ICIV:AKWD:3OKQ:HUSC
Reprint Please indicate this article address in the form of a link
This article address: http://blog.csdn.net/kongxx/article/details/50310653