From b348a31fc955dd6500a4aa9537bbef51688a181e Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 1 Jul 2024 14:37:08 -0700 Subject: [PATCH] Add `git` to CLI variants - `docker build .` / `docker buildx build .` might shell out to git to ask about the context directory's `git status` - `DOCKER_BUILDKIT=0 docker build https://example/foo.git` will run git in the client context - `docker buildx build https://example/foo.git` will run git in the daemon context --- 24/cli/Dockerfile | 4 +++- 25/cli/Dockerfile | 4 +++- 26/cli/Dockerfile | 4 +++- 27/cli/Dockerfile | 4 +++- Dockerfile-cli.template | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/24/cli/Dockerfile b/24/cli/Dockerfile index 7ebc95129..719cf6cbc 100644 --- a/24/cli/Dockerfile +++ b/24/cli/Dockerfile @@ -9,7 +9,9 @@ FROM alpine:3.20 RUN apk add --no-cache \ ca-certificates \ # DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014 - openssh-client + openssh-client \ +# https://github.com/docker-library/docker/issues/482#issuecomment-2197116408 + git # ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses) # - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111 diff --git a/25/cli/Dockerfile b/25/cli/Dockerfile index 25a9fcf3a..4eeb1c433 100644 --- a/25/cli/Dockerfile +++ b/25/cli/Dockerfile @@ -9,7 +9,9 @@ FROM alpine:3.20 RUN apk add --no-cache \ ca-certificates \ # DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014 - openssh-client + openssh-client \ +# https://github.com/docker-library/docker/issues/482#issuecomment-2197116408 + git # ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses) # - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111 diff --git a/26/cli/Dockerfile b/26/cli/Dockerfile index 3a93add2c..c8a83d70e 100644 --- a/26/cli/Dockerfile +++ b/26/cli/Dockerfile @@ -9,7 +9,9 @@ FROM alpine:3.20 RUN apk add --no-cache \ ca-certificates \ # DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014 - openssh-client + openssh-client \ +# https://github.com/docker-library/docker/issues/482#issuecomment-2197116408 + git # ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses) # - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111 diff --git a/27/cli/Dockerfile b/27/cli/Dockerfile index 1471fb1a0..6c57a5628 100644 --- a/27/cli/Dockerfile +++ b/27/cli/Dockerfile @@ -9,7 +9,9 @@ FROM alpine:3.20 RUN apk add --no-cache \ ca-certificates \ # DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014 - openssh-client + openssh-client \ +# https://github.com/docker-library/docker/issues/482#issuecomment-2197116408 + git # ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses) # - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111 diff --git a/Dockerfile-cli.template b/Dockerfile-cli.template index 0e6e131cd..5b9eb2ac0 100644 --- a/Dockerfile-cli.template +++ b/Dockerfile-cli.template @@ -4,7 +4,9 @@ FROM alpine:3.20 RUN apk add --no-cache \ ca-certificates \ # DOCKER_HOST=ssh://... -- https://github.com/docker/cli/pull/1014 - openssh-client + openssh-client \ +# https://github.com/docker-library/docker/issues/482#issuecomment-2197116408 + git # ensure that nsswitch.conf is set up for Go's "netgo" implementation (which Docker explicitly uses) # - https://github.com/moby/moby/blob/v24.0.6/hack/make.sh#L111