From c885b252b7553f19e9157586def829497401cd51 Mon Sep 17 00:00:00 2001 From: Christian Leithner Date: Tue, 4 Aug 2026 13:56:46 +0000 Subject: [PATCH 1/3] fix(docker): apply host networking via compose override in dockerw The dockerw -H flag passed "--network host" to "docker compose run", but that flag only exists for "docker run"; "docker compose run" rejects it with an unknown-flag error. Apply host networking by layering the existing docker/compose.host-network.yaml override instead, matching the devcontainer mechanism. --- dockerw | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dockerw b/dockerw index 7efb7f55..002229e3 100755 --- a/dockerw +++ b/dockerw @@ -51,7 +51,7 @@ while getopts ":ne:dH" opt; do DEV_VOL="-v /dev:/dev" ;; H) # use host networking (useful for Matter device access) - HOST_NETWORK="--network host" + HOST_NETWORK="1" ;; esac done @@ -62,7 +62,14 @@ DIR=$(pwd) # generate the `docker/.env` file and ensure the network/image is created $DIR/docker/setupDockerEnv.sh -COMPOSE_FILE="${DIR}/docker/compose.yaml" +# `docker compose run` has no `--network` flag, so host networking is applied by +# layering the host-network override compose file (which sets network_mode: host +# and resets the base network) rather than passing a flag to the run command. +COMPOSE_FILES="-f ${DIR}/docker/compose.yaml" + +if [ -n "$HOST_NETWORK" ]; then + COMPOSE_FILES="${COMPOSE_FILES} -f ${DIR}/docker/compose.host-network.yaml" +fi EXTRA_VOLUMES="${DEV_VOL}" @@ -74,11 +81,10 @@ USER_ID=$(id -u -n) RANDOM_NUMBER=$(shuf -i 100000-999999 -n 1) CONTAINER_NAME="${USER_ID}_${RANDOM_NUMBER}" -docker compose -f "${COMPOSE_FILE}" run \ +docker compose ${COMPOSE_FILES} run \ --rm \ --name ${CONTAINER_NAME} \ ${COMPOSE_INTERACTIVE_FLAGS} \ - ${HOST_NETWORK} \ --workdir "${DIR}" \ ${VOLUMES_ARGS} \ ${EXTRA_ENV} \ From 12849fb887d13b643fef8e6ec800ed13cb592191 Mon Sep 17 00:00:00 2001 From: Christian Leithner <87389808+cleithner-comcast@users.noreply.github.com> Date: Tue, 4 Aug 2026 09:03:12 -0500 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- dockerw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerw b/dockerw index 002229e3..8d0925ac 100755 --- a/dockerw +++ b/dockerw @@ -65,10 +65,10 @@ $DIR/docker/setupDockerEnv.sh # `docker compose run` has no `--network` flag, so host networking is applied by # layering the host-network override compose file (which sets network_mode: host # and resets the base network) rather than passing a flag to the run command. -COMPOSE_FILES="-f ${DIR}/docker/compose.yaml" +COMPOSE_FILES=(-f "${DIR}/docker/compose.yaml") if [ -n "$HOST_NETWORK" ]; then - COMPOSE_FILES="${COMPOSE_FILES} -f ${DIR}/docker/compose.host-network.yaml" + COMPOSE_FILES+=(-f "${DIR}/docker/compose.host-network.yaml") fi EXTRA_VOLUMES="${DEV_VOL}" From da66ffd3fe290ce3514948764ab3deb852c69176 Mon Sep 17 00:00:00 2001 From: Christian Leithner Date: Tue, 4 Aug 2026 15:46:44 +0000 Subject: [PATCH 3/3] fix(docker): expand COMPOSE_FILES array correctly in dockerw COMPOSE_FILES was assigned as a bash array but referenced with scalar ${COMPOSE_FILES}, which expands to only the first element (-f). That turned the invocation into "docker compose -f run ...", where -f consumed "run" as the compose-file path and "--rm" was parsed as a top-level flag, failing with "unknown flag: --rm". Expand with "${COMPOSE_FILES[@]}" instead. --- dockerw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerw b/dockerw index 8d0925ac..369edd91 100755 --- a/dockerw +++ b/dockerw @@ -81,7 +81,7 @@ USER_ID=$(id -u -n) RANDOM_NUMBER=$(shuf -i 100000-999999 -n 1) CONTAINER_NAME="${USER_ID}_${RANDOM_NUMBER}" -docker compose ${COMPOSE_FILES} run \ +docker compose "${COMPOSE_FILES[@]}" run \ --rm \ --name ${CONTAINER_NAME} \ ${COMPOSE_INTERACTIVE_FLAGS} \