Modify the configuration

Configure the Docker Daemon. Modify the default storage location of the Docker daemon and configure the default disk size allocated by the container and log limit

Daemon. Json -- "graph": "/data/docker", # change docker default storage location "live-restore": true "storage-driver": Overlay2 ", "storage-opts": ["overlay2.override_kernel_check=true", "overlay2.size=10G", "log-driver": "Json - file", "log - opts" : {" Max - size ":" 5 m ", "Max - the file" : "3" # log configuration},Copy the code

After modifying the configuration file, run systemctl daemon-reload && systemctl restart docker

Problems that need to be solved

The current docker uses storage-driver to configure the default container space for overlay2. The disk quota function must be enabled on the physical machine XFS file system; otherwise, docker startup fails

XFS file system configuration method

  1. First unmount the disk
  2. Modify mount parameters add, USrQuota, PRjquota

3. Mount the file again and view the modified parameters

View the modified result

The container default disk is changed to 10 GB

Log files are always limited to a specified size and number of configurations