More The default storage directory for Docker

Source: Internet
Author: User

Docker

System: Ubuntu

By default, Docker is stored in:/var/lib/docker

You can see the exact location by following the command:

sudo docker info | grep "Docker Root Dir"

This method is implemented via a soft connection.

First stop the Docker service:

Systemctl Restart Docker or service Docker stop

Then move the entire/var/lib/docker directory to the destination path:

Mv/var/lib/docker/root/data/docker

Create a soft link

Ln-s/root/data/docker/var/lib/docker

When you start Docker, you find that the storage directory is still/var/lib/docker, but it is actually stored on the data disk, and you can see the volume change on the data disk.

One thing to note here is that it is important to move the entire Docker under the/var/lib/to a different directory (in other words, the Docker directory does not exist in the/var/lib/directory before the soft link is created, and the soft link created is valid)

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.