To set the Docker runtime root directory

Source: Internet
Author: User

For the first time playing Docker, the system did not allocate/var partition, and more than 500 g of the remaining space is divided to the/home.
When playing Docker, only to find this goods default storage location is in/var/lib/docker.
There are two solutions: one is to reload the system, which is too impersonal, ignoring ... The next time you deploy the Docker host, you need to be properly partitioned.

The second is to change the Docker default storage path.

Check it out. Manual found:-G,--graph= "/var/lib/docker" set Docker runtime root directory
Using the--graph parameter: Docker--graph=/opt/docker-d automatically generates the/opt/docker directory (0700) and creates Docker related files under that directory

The original mirrors and containers were not found because the path was changed (the original mirror was
In/var/lib/docker/devicemapper/devicemapper/{data,metadata})
Docker configuration files can set most of the background process parameters, the storage location in each operating system is inconsistent
The location in Ubuntu is:/etc/default/docker
The position in the CentOS is:/etc/sysconfig/docker
I use CentOS 7, so I just need to change vim/etc/sysconfig/docker into


Options=--graph= "/home/lib/docker"--selinux-enabled-h fd://

Then the service Docker start restarts the Docker path to/home/lib/docker.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.