Use transient mode in podman.
This commit is contained in:
1 parent
a064978a93
commit
b56f8facf3
5 files changed
+44
-4
No files matched your search
@@ -0,0 +1,20 @@
|
||||
# This service runs once each boot to remove potential leftover
|
||||
# container state from previous boots.
|
||||
|
||||
# This is needed as we're using transient mode in podman where the
|
||||
# database and other configs are stored in tmpfs, but some other files
|
||||
# are not. If we don't run this after ane unclean boot then there may
|
||||
# be leftover files that collect over time.
|
||||
|
||||
[Unit]
|
||||
Description=Clean up podman transient data
|
||||
RequiresMountsFor=%t/containers
|
||||
Requires=boot-complete.target
|
||||
After=local-fs.target boot-complete.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/podman system prune --external
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -3,6 +3,11 @@
|
||||
driver = "overlay"
|
||||
runroot = "/run/containers/storage"
|
||||
graphroot = "/var/lib/containers/storage"
|
||||
# Enables a global transient storaga mode where all container metadata is stored on non-persistant media
|
||||
# This guaranteea a fresh state on boot.
|
||||
# However it is not compabible with a traditional model where containers persist across reboots.
|
||||
# Use with `podman-clean-transient.service`
|
||||
transient_store = true
|
||||
|
||||
[storage.options]
|
||||
# We add a custom "/usr/share/containers/storage" here to allow readonly in-image containers
|
||||
|
||||
Reference in new issue
Block a user