-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman run: add ability to store files written inside a container in host's tmpfs. #17599
Comments
@giuseppe @vrothberg WDYT? Using tmpfs for this could be risky since you have limited disk space. Specifying where to store the upper/Container directory might be useful. |
Yes, I know. I have plenty of memory on the host. The software I run writes many files inside the container in random places (actually installs packages) and then run some process reading these files. I can not preinstall these packages before |
could you try if
|
@giuseppe
I added newlines for readability. |
|
thanks for verifying that. Another option could be to pull the images in your store on
|
I like that idea, Perhaps a small blog on it. |
Unbelievable! It works! So, I suggest some standard option that do this. Because it's really non-trivial. For example, I still don't understand why it stops working if I remove It will be very useful for |
if you drop the I wouldn't make it too easy for users to end up in this setup, we can document or better as @rhatdan suggested have a blog but users must be sure of what they do. Using tmpfs for the upper layer is an unusual configuration, you can easily run out of memory and the entire container storage is lost on a power cycle. One thing I'd like to mention is that if you specify |
Hmm. What approach/method is used to inhibit fsyncs ?! |
the |
|
Since there is a working solution for the problem, I am closing the issue. |
@giuseppe
Is it a bug? Do I need transient store in this case ?
Does Also, I guess
Now I run podman this way: storage_dir=$(sudo podman image inspect "$image:$BRANCH" | jq -r '.[0].GraphDriver.Data.UpperDir' | sed -E 's|/overlay/[a-f0-9]+/diff$||')
sudo unshare --mount -- sh -c 'mount none -t tmpfs /tmp && mkdir /tmp/layer && exec "$@"' -- podman run --root /tmp/layer --storage-opt AdditionalImageStore=$storage_dir "$image:$BRANCH" ... It's not straightforward, but works. |
I think you need to reset your system to change to a transient store. |
@rhatdan I can, but these scripts used by many developers in my company. Should they all reset? Why reset is needed ? |
You want many users to use tmpfs for store, Are these for all containers or only for a few and then use traditional storage for others? |
Reasonable question. Unfortunately, only for SOME containers. If I needed all, I would just change main configuration of podman to store layers in tmpfs. The main idea is to store everything I get using |
Feature request description
Software I run in a container scatters different files everywhere. Everything works, but slow because these changes are stored in the same FS where layers of the image are (disk). I need podman to make final overlayfs with
workdir
andupperdir
in tmpfs. I don't need any files stored in the container after its death.The text was updated successfully, but these errors were encountered: