Last active
February 24, 2022 15:06
-
-
Save jedvardsson/df4d88a06074900f1eb3b2cb41d00c3a to your computer and use it in GitHub Desktop.
Test to reproduce buildkit network mode not supported https://github.com/moby/buildkit/issues/978
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o pipefail | |
function finally() { | |
docker stop -t 1 my-nginx || true | |
} | |
trap finally EXIT | |
function log_info() { | |
echo -e "\\e[1;34m[INFO]\\e[0m" "$@" | |
} | |
log_info "starting my-nginx" | |
docker run --rm --name my-nginx -d nginx | |
log_info "build --network=container:my-nginx..." | |
docker build --network=container:my-nginx - <<EOF | |
FROM alpine | |
RUN apk add --no-cache curl | |
RUN curl -sS http://localhost:80 > /dev/null | |
EOF | |
log_info "It works!" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script to reproduce
Error response from daemon: network mode "container:my-nginx" not supported by buildkit
moby/buildkit#978