mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
quadlet: Change default of ReadOnly to no
This matches the default podman run behaviour. Signed-off-by: Alexander Larsson <alexl@redhat.com>
This commit is contained in:
@ -138,7 +138,7 @@ For example:
|
|||||||
AddCapability=CAP_DAC_OVERRIDE CAP_IPC_OWNER
|
AddCapability=CAP_DAC_OVERRIDE CAP_IPC_OWNER
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `ReadOnly=` (defaults to `yes`)
|
#### `ReadOnly=` (defaults to `no`)
|
||||||
|
|
||||||
If enabled, makes image read-only, with /var/tmp, /tmp and /run a tmpfs (unless disabled by `VolatileTmp=no`).
|
If enabled, makes image read-only, with /var/tmp, /tmp and /run a tmpfs (unless disabled by `VolatileTmp=no`).
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
|
|||||||
podman.addf("--cap-add=%s", strings.ToLower(caps))
|
podman.addf("--cap-add=%s", strings.ToLower(caps))
|
||||||
}
|
}
|
||||||
|
|
||||||
readOnly := container.LookupBoolean(ContainerGroup, KeyReadOnly, true)
|
readOnly := container.LookupBoolean(ContainerGroup, KeyReadOnly, false)
|
||||||
if readOnly {
|
if readOnly {
|
||||||
podman.add("--read-only")
|
podman.add("--read-only")
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
## assert-podman-args "--cgroups=split"
|
## assert-podman-args "--cgroups=split"
|
||||||
## assert-podman-args "--sdnotify=conmon"
|
## assert-podman-args "--sdnotify=conmon"
|
||||||
## assert-podman-args "--cap-drop=all"
|
## assert-podman-args "--cap-drop=all"
|
||||||
## assert-podman-args "--read-only"
|
|
||||||
## !assert-podman-args "--read-only-tmpfs=false"
|
|
||||||
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
||||||
## assert-key-is "Service" "KillMode" "mixed"
|
## assert-key-is "Service" "KillMode" "mixed"
|
||||||
## assert-key-is "Service" "Delegate" "yes"
|
## assert-key-is "Service" "Delegate" "yes"
|
||||||
|
@ -3,4 +3,5 @@
|
|||||||
|
|
||||||
[Container]
|
[Container]
|
||||||
Image=localhost/imagename
|
Image=localhost/imagename
|
||||||
|
ReadOnly=yes
|
||||||
VolatileTmp=no
|
VolatileTmp=no
|
||||||
|
Reference in New Issue
Block a user