Skip to content

Commit

Permalink
Run docker via run_host_command_logged
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheCoolingFan committed Aug 15, 2024
1 parent 811bd65 commit dd680a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/functions/host/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dd680a4

Please sign in to comment.