this post was submitted on 29 Mar 2024
18 points (90.9% liked)

Linux

47817 readers
731 users here now

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.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I've got two internal SSDs, of which one is smaller (128) and one is bigger (1TB). How can I tell podman (or docker) to use another folder? Currently, it sits on the smaller drive which has less and less storage.

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 6 months ago* (last edited 6 months ago) (1 children)

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.~~

LE: https://ahelpme.com/software/podman/change-the-location-of-container-storage-in-podman-with-selinux-enabled/

[–] [email protected] 1 points 6 months ago

Thx, I'll check it out

[–] [email protected] 2 points 6 months ago* (last edited 6 months ago)

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!