Docker-in-LXC: run containers AppArmor-unconfined (idempotent, fixes existing LXCs)

This commit is contained in:
jtricerolph 2026-07-01 13:17:20 +00:00
parent 5fcf1f62e9
commit 69db7d5426
2 changed files with 57 additions and 37 deletions

View file

@ -124,8 +124,11 @@ pct create "$LXC_ID" "$TEMPLATE" \
--unprivileged 0 \
--onboot 1 \
--tags "${POOL}" \
${POOL_OPT} \
--start 1 &>/dev/null
${POOL_OPT} &>/dev/null
# Docker-in-LXC: run AppArmor-unconfined so containers can start
grep -q '^lxc.apparmor.profile: unconfined' "/etc/pve/lxc/${LXC_ID}.conf" 2>/dev/null \
|| echo "lxc.apparmor.profile: unconfined" >> "/etc/pve/lxc/${LXC_ID}.conf"
pct start "$LXC_ID" &>/dev/null
sleep 5
msg_ok "LXC ${LXC_ID} created"