Run docker via run_host_command_logged

This commit is contained in:
JohnTheCoolingFan
2024-08-15 12:27:26 +03:00
committed by Igor
parent 1045fda3d4
commit bed3f85213

View File

@@ -574,9 +574,10 @@ function docker_cli_launch() {
# This check is performed in order to set up the host so that it has a loop device, as calling losetup inside of
# docker creates a loop device but does not make it available to the already running container
# The amount of privileges and capabilities given is a bare minimum needed for losetup to work
if [[ ! -e /dev/loop0 ]]; then
display_alert "Running losetup in a temporary container" "because no loop devices exist" "info"
docker run "${DOCKER_ARGS[@]}" "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" /usr/sbin/losetup -f
run_host_command_logged docker run --rm --privileged --cap-add=MKNOD "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" /usr/sbin/losetup -f
fi
display_alert "-----------------Relaunching in Docker after ${SECONDS}s------------------" "here comes the 🐳" "info"