I am running the docker daemon from directory sitting in my root volume (/var/lib/docker). When I launch more containers, it compromises my disk space and start throwing an error Insufficient space
. After reading a little about docker daemon and how it works, I was able to change the docker root directory to the new mounted volume (/data) which has enough space for the number of containers I am running. But what that do is, it runs everything via new directory (/data).
What I want is:
All the container images that are already present should stay in the root volume (/var/lib/docker) while all the new container images that I am going to download should get downloaded in a new directory (/data). Kinda where I can have 2 data directories backing up the docker daemon. I can have some images in one and some in another.
What I have already tried:
- I have already tried changing the root data directory for the docker daemon but that changes for all the images. It now move everything to the new volume (/data) and there is nothing present anymore on (/var/lib/docker)
- I tried creating symlinks as well, but that also doesn’t work for the use case I have.
Can anyone point me in the right direction if what I am trying to achieve is possible or not?