Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow azd up to use host network during docker build #4758

Open
surajssd opened this issue Feb 4, 2025 · 0 comments
Open

Allow azd up to use host network during docker build #4758

surajssd opened this issue Feb 4, 2025 · 0 comments

Comments

@surajssd
Copy link
Member

surajssd commented Feb 4, 2025

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,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants