hack3rcon
(Hack3rcon)
March 22, 2024, 1:22pm
1
Hello,
I want to change the default Docker storage location to another hard disk, a SAN or a NAS. I have a few questions:
1- I found two articles How to change Docker storage location - Dmytro Kryvokhyzha and https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux . Which one is good?
2- What kind of file system is more suitable for this task and has a higher speed?
Cheers.
A local NVMe SSD has higher speed, everything across wire (NAS on LAN) will usually be slower.
1 Like
hack3rcon
(Hack3rcon)
March 23, 2024, 11:55am
3
Hi,
Thank you so much for your reply.
Which of those tutorials is suitable for changing the default Docker storage?
I would use the last part of the first link: edit /etc/docker/daemon.json
and add or change the data directory setting.
1 Like
hack3rcon
(Hack3rcon)
April 9, 2024, 2:01pm
5
Hello,
Thank you so much for your reply.
1- It is written in the article that the old containers remain in the /etc/default/docker
address. Can’t they be moved to a new location and not downloaded again?
2- There are a number of directories, each containing a YAML file. Is it possible to tell Docker to automatically check and download all YAML files?
hack3rcon
(Hack3rcon)
April 10, 2024, 10:44am
6
Hello,
I stopped Docker:
# systemctl stop docker
Then, I did the following steps:
# touch /etc/docker/daemon.json
# nano /etc/docker/daemon.json
{
"data-root": "/mnt/new"
}
After it, I moved /var/lib/docker
directory to /mnt/new
directory and started the Docker service:
# systemctl start docker
But, when I use docker compose up -d
, then it wants to download all the containers again.
What is wrong?
hack3rcon
(Hack3rcon)
April 11, 2024, 7:24pm
7
Hello,
Problem solved.
I modified the daemon.json
file as below:
{
"data-root": "/mnt/new/docker"
}