- Install the necessary packages:
sudo apt-get update
sudo apt-get install xfsprogs
-
Identify the disk or partition you want to use for the new filesystem. You can use the
lsblk
orfdisk -l
command to list the available disks and partitions. Make sure you select the correct one as this process will erase all data on it. -
If the partition you want to use is not formatted, format it with an XFS filesystem. Replace
/dev/sdX
with the appropriate device identifier:
sudo mkfs.xfs /dev/sdX
- Once the partition is formatted, create a mount point. This will be the directory where the new filesystem will be mounted:
sudo mkdir /mnt/docker
- Update the
/etc/fstab
file to automatically mount the new filesystem at boot:
/dev/sdX /mnt/docker xfs defaults,nofail,discard,noatime,quota,prjquota,pquota,gquota 0 2
- Mount the new filesystem and verify that it is working:
sudo mount -a
df -h
The output of df -h
should show the new filesystem mounted at /mnt/docker
.
- Stop the docker daemon:
systemctl stop docker
- Update the
/etc/docker/daemon.json
file to point docker to the new mount point:
{
"data-root": "/mnt/docker"
}
- Start the docker daemon:
systemctl start docker
- Build the images:
su - codapi
make images
- Verify that docker can now limit the storage size:
docker run -it --storage-opt size=16m codapi/alpine /bin/df -h | grep overlay