0

During build steps of a docker image, I get errors on insufficient storage space. I've limited space on / but recently managed to mount a new storage device on /data. So how can I force docker daemon to use that directory to store underlying container and images data? or even move existing images and containers to there.

1 Answer 1

1

You can do it by by modifying systemd's docker start up script. Open file /lib/systemd/system/docker.service with your favorite text editor and replace the following line where /data/path/docker is a location of your new chosen docker directory:

FROM: ExecStart=/usr/bin/docker daemon -H fd:// TO: ExecStart=/usr/bin/docker daemon -g /data/path/docker -H fd:// 

When ready stop docker service:

systemctl stop docker 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.