Skip to content

Commit 7566539

Browse files
tmshlvckclaude
andcommitted
Fix Podman networking and relaunch command for podman-docker shim
- Add --network=host for podman-docker shim detection (not just standalone podman) - Add --network=host to docker build command for Podman compatibility - Fix relaunch command to use 'build' instead of 'docker' inside container Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1f420b3 commit 7566539

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/functions/cli/cli-docker.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ function cli_docker_run() {
7676
fi
7777

7878
# Produce the re-launch params.
79+
# When relaunching inside docker, run 'build' command, not 'docker' again
80+
declare -g ARMBIAN_CLI_RELAUNCH_COMMAND="build"
7981
declare -g ARMBIAN_CLI_FINAL_RELAUNCH_ARGS=()
8082
declare -g ARMBIAN_CLI_FINAL_RELAUNCH_ENVS=()
8183
produce_relaunch_parameters # produces ARMBIAN_CLI_FINAL_RELAUNCH_ARGS and ARMBIAN_CLI_FINAL_RELAUNCH_ENVS

lib/functions/host/docker.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function get_docker_info_once() {
6363
# Check if 'docker' is actually podman (e.g., podman-docker package)
6464
if docker --version | grep -q podman; then
6565
DOCKER_IS_PODMAN="yes"
66+
DOCKER_NETWORK="--network host"
6667
display_alert "Podman detected" "docker command is podman alias" "info"
6768
fi
6869
elif [[ -n "$(command -v podman)" ]]; then
@@ -391,8 +392,15 @@ function docker_cli_build_dockerfile() {
391392

392393
display_alert "Building" "Dockerfile via '${DOCKER_BUILDX_OR_BUILD[*]}'" "info"
393394

395+
# Podman needs --network=host for build to have proper network access
396+
declare -a docker_build_network_args=()
397+
if [[ "${DOCKER_IS_PODMAN}" == "yes" ]]; then
398+
docker_build_network_args=("--network=host")
399+
display_alert "Adding host networking to build" "for Podman compatibility" "info"
400+
fi
401+
394402
BUILDKIT_COLORS="run=123,20,245:error=yellow:cancel=blue:warning=white" \
395-
run_host_command_logged $DOCKER_COMMAND "${DOCKER_BUILDX_OR_BUILD[@]}" -t "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" -f "${SRC}"/Dockerfile "${SRC}"
403+
run_host_command_logged $DOCKER_COMMAND "${DOCKER_BUILDX_OR_BUILD[@]}" "${docker_build_network_args[@]}" -t "${DOCKER_ARMBIAN_INITIAL_IMAGE_TAG}" -f "${SRC}"/Dockerfile "${SRC}"
396404
}
397405

398406
function docker_cli_prepare_launch() {

0 commit comments

Comments
 (0)