paul.ruelle
paul.ruelle

Reputation: 132

Change default dir for docker images (using docker snap)

On my app, docker compose images on a default location : data/dev/xvda1

I added a new storage on AWS and mount it on my server :

/dev/xvdf         20961280   53920  20907360   1% 
/data/dev/xvda1   8065444 2400580   5648480  30%

How can I tell docker to compose images on it ?

I already tried to edit /var/snap/docker/current/config/daemon.json, which is :

{
    "log-level": "error",
    "storage-driver": "overlay2"

}

but docker fails to start and compose.

Thanks for your help

Upvotes: 0

Views: 930

Answers (1)

Shashank V
Shashank V

Reputation: 11223

You can use data-root option to change the location.

{
    "log-level": "error",
    "storage-driver": "overlay2",
    "data-root": "/dev/xvdf",
}

https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

Upvotes: 0

Related Questions