Right now there is no way to tell azd up to use --network=host when it does docker build behind the scene. It would great if azd added a way for the users to ask it to use host network when doing the docker build.
Right now my workaround is to get create a script called docker and put it into the PATH before the actual docker binary. And the script does this:
#!/usr/bin/env bash
set -euo pipefail
DOCKER_BIN="/usr/bin/docker"
# Check if we are calling docker build only then we will use the --network=host flag
if [ "$1" == "build" ]; then
shift
exec "${DOCKER_BIN}" build --network=host "$@"
fi
exec "${DOCKER_BIN}" "$@"
The flag would ideally go in this list:
|
args := []string{ |
|
"build", |
|
"-f", dockerFilePath, |
|
"--platform", platform, |
|
} |
Right now there is no way to tell
azd upto use--network=hostwhen it doesdocker buildbehind the scene. It would great ifazdadded a way for the users to ask it to use host network when doing thedocker build.Right now my workaround is to get create a script called
dockerand put it into the PATH before the actualdockerbinary. And the script does this:The flag would ideally go in this list:
azure-dev/cli/azd/pkg/tools/docker/docker.go
Lines 84 to 88 in 9e65413