mirror of
https://github.com/containers/podman.git
synced 2025-12-19 07:09:39 +08:00
Add containers.conf read-only flag support
If you are running temporary containers within podman play kube we should really be running these in read-only mode. For automotive they plan on running all of their containers in read-only temporal mode. Adding this option guarantees that the container image is not being modified during the running of the container. The containers can only write to tmpfs mounted directories. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@@ -951,4 +951,17 @@ $IMAGE--c_ok" \
|
||||
run_podman stop -t 0 $cid
|
||||
}
|
||||
|
||||
@test "podman run read-only from containers.conf" {
|
||||
containersconf=$PODMAN_TMPDIR/containers.conf
|
||||
cat >$containersconf <<EOF
|
||||
[containers]
|
||||
read_only=true
|
||||
EOF
|
||||
|
||||
CONTAINERS_CONF="$containersconf" run_podman 1 run --rm $IMAGE touch /testro
|
||||
CONTAINERS_CONF="$containersconf" run_podman run --rm --read-only=false $IMAGE touch /testrw
|
||||
CONTAINERS_CONF="$containersconf" run_podman run --rm $IMAGE touch /tmp/testrw
|
||||
CONTAINERS_CONF="$containersconf" run_podman 1 run --rm --read-only-tmpfs=false $IMAGE touch /tmp/testro
|
||||
}
|
||||
|
||||
# vim: filetype=sh
|
||||
|
||||
Reference in New Issue
Block a user