Linux modifies Docker images and container data storage locations

Source: Internet
Author: User

The parameter specifying the mirror and container storage path is--graph=/var/lib/docker, whose default storage location is /var/lib/docker,

Docker configuration file can set most of the background process parameters, in the various operating systems in the storage location inconsistent,

1. The location in Ubuntu is:/etc/default/docker,

Options=--graph= "/root/data/docker"-H fd://# or docker_opts= "-g/root/data/docker"

After the last reboot, the Docker path is changed to/root/data/docker.

2. The location in CentOS is:/etc/sysconfig/docker.

2-1) Modify the Docker.service file and use the-G parameter to specify the storage location

VI /usr/lib/systemd/system/docker.service  

Execstart=/usr/bin/dockerd --graph/new-path/docker

2-2) Reload configuration file

2-3) Restart Docker

Systemctl Restart Docker.service

2-4) View Docker Root Dir:/var/lib/docker changed to a set directory/new-path/docker

Info

Linux modifies Docker images and container data storage locations

Related Article

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.