set nesting at launch

This commit is contained in:
Kay0u 2021-03-10 10:43:02 +01:00
parent ecf28bd046
commit 277e986a9a
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 3 additions and 6 deletions

View file

@ -23,8 +23,7 @@ start_container () {
exit $SYSTEM_FAILURE_EXIT_CODE
fi
lxc launch "$BASE_IMAGE-$SNAPSHOT_NAME" "$CONTAINER_ID" 2>/dev/null
lxc config set "$CONTAINER_ID" security.nesting true
lxc launch "$BASE_IMAGE-$SNAPSHOT_NAME" "$CONTAINER_ID" -c security.nesting=true 2>/dev/null
mkdir -p $current_dir/cache
chmod 777 $current_dir/cache

View file

@ -158,12 +158,10 @@ rebuild_base_containers()
local arch=$3
local base_image_to_rebuild="yunohost-$debian_version-$ynh_version"
lxc launch images:debian/$debian_version/$arch "$base_image_to_rebuild-tmp"
lxc launch images:debian/$debian_version/$arch "$base_image_to_rebuild-tmp" -c security.nesting=true
wait_container "$base_image_to_rebuild-tmp"
lxc config set "$base_image_to_rebuild-tmp" security.nesting true # Need this for buster because it is using apparmor
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get update"
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "apt-get install --assume-yes wget curl"
# Install Git LFS, git comes pre installed with ubuntu image.
@ -231,7 +229,7 @@ update_image() {
fi
# Start and run upgrade
lxc launch "$image_to_update" "$image_to_update-tmp"
lxc launch "$image_to_update" "$image_to_update-tmp" -c security.nesting=true
wait_container "$image_to_update-tmp"