For docker, you have to create /etc/docker/daemon.json
and set:
{
"data-root": "/docker"
}
You can move your /var/lib/docker while the daemon is stopped. I had no issues when I did the move.
~~I don't know how to change this for podman.~~
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
For docker, you have to create /etc/docker/daemon.json
and set:
{
"data-root": "/docker"
}
You can move your /var/lib/docker while the daemon is stopped. I had no issues when I did the move.
~~I don't know how to change this for podman.~~
Thx, I'll check it out
I would like to know this as well.
So far, it seems it's a bit easier to do with Podman / "standard OCI containers" because they're rootless and get stored in my home directory. But the solution I keep seeing is to move the directory and then symlink or mount bind the folder. I do the latter so that podman continues to work when that external drive isn't connected.
This does actually work, but I really don't like it. Why isn't there a way to store a container entirely in a specific location and then run straight from that location?
The alternative is to provide Podman a custom storage.conf for a specific location. But that too is a "permanent" change. I would love to know a cleaner solution to portable containers!