Skip to content

Commit a4f8f22

Browse files
committed
Merge pull request #6190 from thaJeztah/fork_remotecontext
add local fork of github.com/docker/docker/builder/remotecontext (cherry picked from commit 8c317ad) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 7d3bde0 commit a4f8f22

File tree

10 files changed

+433
-7
lines changed

10 files changed

+433
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
3131
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build-base-alpine
3232
ENV GOTOOLCHAIN=local
3333
COPY --link --from=xx / /
34-
RUN apk add --no-cache bash clang lld llvm file git
34+
RUN apk add --no-cache bash clang lld llvm file git git-daemon
3535
WORKDIR /go/src/github.com/docker/cli
3636

3737
FROM build-base-alpine AS build-alpine

cli/command/image/build/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"strings"
1717
"time"
1818

19-
"github.com/docker/docker/builder/remotecontext/git"
19+
"github.com/docker/cli/cli/command/image/build/internal/git"
2020
"github.com/docker/docker/pkg/progress"
2121
"github.com/docker/docker/pkg/streamformatter"
2222
"github.com/moby/go-archive"

cli/command/image/build/context_detect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/docker/docker/builder/remotecontext/urlutil"
7+
"github.com/docker/cli/cli/command/image/build/internal/urlutil"
88
)
99

1010
// ContextType describes the type (source) of build-context specified.

vendor/github.com/docker/docker/builder/remotecontext/git/gitutils.go renamed to cli/command/image/build/internal/git/gitutils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ func supportsShallowClone(remoteURL string) bool {
148148

149149
// Try a HEAD request and fallback to a Get request on error
150150
res, err := http.Head(serviceURL) // #nosec G107
151+
if err == nil {
152+
_ = res.Body.Close()
153+
}
151154
if err != nil || res.StatusCode != http.StatusOK {
152155
res, err = http.Get(serviceURL) // #nosec G107
153156
if err == nil {

0 commit comments

Comments
 (0)