-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathqm.container
89 lines (77 loc) · 2.68 KB
/
qm.container
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[Install]
WantedBy=default.target
[Service]
# It's recommended to use systemd drop-in to override the
# systemd settings. See QM manpage for an example.
CPUWeight=50
Delegate=true
IOWeight=50
ManagedOOMSwap=kill
# MemoryMax
# -----------
# Default is infinity - sets no upper bound on memory usage, allowing the
# service to consume as much memory as the system allows, just like
# MemoryMax=0 or omitting it.
MemoryMax=infinity
# MemoryHigh
# -----------
# Default is infinity - Disables the soft memory limit, meaning no throttling
# will occur due to high memory usage, similar to MemoryHigh=0 or
# omitting it.
MemoryHigh=infinity
MemorySwapMax=0
# Containers within the qm contain default set OOMScoreAdj to 750
OOMScoreAdjust=500
Restart=always
Slice=QM.slice
Environment=ROOTFS=/usr/lib/qm/rootfs
Environment=RWETCFS=/etc/qm
Environment=RWVARFS=/var/qm
LimitNOFILE=65536
TasksMax=50%
[Container]
# AddCapability
# -------------
# Add these capabilities, in addition to the default Podman capability set, to the container.
# If set to all, grants all capabilities to the container, increasing flexibility but significantly
# reducing security.
# For details see: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html#addcapability
AddCapability=all
# Unmask
# -------
# Specify the paths to unmask separated by a colon. unmask=ALL or /path/1:/path/2, or shell expanded paths (/proc/*):
# If set to ALL, Podman will unmask all the paths that are masked or made read-only by default.
# For details see: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html#unmask
Unmask=ALL
SecurityLabelNested=true
SeccompProfile=/usr/share/qm/seccomp-no-rt.json
# PidsLimit
# ---------
# Disables the PID limit for the container by setting it to -1.
# Without a limit, the container can spawn unlimited processes, potentially exhausting system resources.
# For details see: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html#pidslimit
PidsLimit=-1
# Comment DropCapability this will allow FFI Tools to surpass their defaults.
DropCapability=sys_resource
AddDevice=-/dev/kvm
AddDevice=-/dev/fuse
ContainerName=qm
Exec=/sbin/init
Network=private
# ReadOnly
# --------
# Makes the container's filesystem read-only, enhancing security by preventing modifications.
ReadOnly=true
# Rootfs
# ------
# Defines the root filesystem location for QM partition.
# By default the '${ROOTFS}' variable points to /usr/lib/qm/rootfs.
# For details see: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html#rootfs
Rootfs=${ROOTFS}
SecurityLabelNested=true
SecurityLabelFileType=qm_file_t
SecurityLabelLevel=s0
SecurityLabelType=qm_t
Timezone=local
Volume=${RWETCFS}:/etc
Volume=${RWVARFS}:/var