Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
| ... | ... |
@@ -134,9 +134,11 @@ FROM delve-${DELVE_SUPPORTED} AS delve
|
| 134 | 134 |
FROM base AS gowinres |
| 135 | 135 |
# GOWINRES_VERSION defines go-winres tool version |
| 136 | 136 |
ARG GOWINRES_VERSION=v0.3.1 |
| 137 |
+ADD https://github.com/tc-hib/go-winres.git?ref=${GOWINRES_VERSION}&keep-git-dir=1 /go/src/github.com/tc-hib/go-winres
|
|
| 137 | 138 |
RUN --mount=type=cache,target=/root/.cache/go-build \ |
| 138 | 139 |
--mount=type=cache,target=/go/pkg/mod \ |
| 139 |
- GOBIN=/build CGO_ENABLED=0 go install "github.com/tc-hib/go-winres@${GOWINRES_VERSION}" \
|
|
| 140 |
+ cd /go/src/github.com/tc-hib/go-winres && \ |
|
| 141 |
+ GOBIN=/build CGO_ENABLED=0 go install . \ |
|
| 140 | 142 |
&& /build/go-winres --help |
| 141 | 143 |
|
| 142 | 144 |
# containerd |
| ... | ... |
@@ -187,27 +189,34 @@ FROM containerd-${TARGETOS} AS containerd
|
| 187 | 187 |
|
| 188 | 188 |
FROM base AS golangci_lint |
| 189 | 189 |
ARG GOLANGCI_LINT_VERSION=v2.8.0 |
| 190 |
+ADD https://github.com/golangci/golangci-lint.git?ref=${GOLANGCI_LINT_VERSION}&keep-git-dir=1 /go/src/github.com/golangci/golangci-lint
|
|
| 190 | 191 |
RUN --mount=type=cache,target=/root/.cache/go-build \ |
| 191 | 192 |
--mount=type=cache,target=/go/pkg/mod \ |
| 192 |
- GOBIN=/build CGO_ENABLED=0 go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \
|
|
| 193 |
+ cd /go/src/github.com/golangci/golangci-lint && \ |
|
| 194 |
+ GOBIN=/build CGO_ENABLED=0 go install ./cmd/golangci-lint \ |
|
| 193 | 195 |
&& /build/golangci-lint --version |
| 194 | 196 |
|
| 195 | 197 |
FROM base AS gotestsum |
| 196 | 198 |
# GOTESTSUM_VERSION is the version of gotest.tools/gotestsum to install. |
| 197 | 199 |
ARG GOTESTSUM_VERSION=v1.13.0 |
| 200 |
+ADD https://github.com/gotestyourself/gotestsum.git?ref=${GOTESTSUM_VERSION}&keep-git-dir=1 /go/src/gotest.tools/gotestsum
|
|
| 198 | 201 |
RUN --mount=type=cache,target=/root/.cache/go-build \ |
| 199 | 202 |
--mount=type=cache,target=/go/pkg/mod \ |
| 200 |
- GOBIN=/build CGO_ENABLED=0 go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \
|
|
| 203 |
+ cd /go/src/gotest.tools/gotestsum && \ |
|
| 204 |
+ GOBIN=/build CGO_ENABLED=0 go install . \ |
|
| 201 | 205 |
&& /build/gotestsum --version |
| 202 | 206 |
|
| 203 | 207 |
FROM base AS shfmt |
| 204 | 208 |
ARG SHFMT_VERSION=v3.8.0 |
| 209 |
+ADD https://github.com/mvdan/sh.git?ref=${SHFMT_VERSION}&keep-git-dir=1 /go/src/mvdan.cc/sh
|
|
| 205 | 210 |
RUN --mount=type=cache,target=/root/.cache/go-build \ |
| 206 | 211 |
--mount=type=cache,target=/go/pkg/mod \ |
| 207 |
- GOBIN=/build CGO_ENABLED=0 go install "mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}" \
|
|
| 212 |
+ cd /go/src/mvdan.cc/sh && \ |
|
| 213 |
+ GOBIN=/build CGO_ENABLED=0 go install ./cmd/shfmt \ |
|
| 208 | 214 |
&& /build/shfmt --version |
| 209 | 215 |
|
| 210 | 216 |
FROM base AS gopls |
| 217 |
+# No ARG GOPLS_VERSION, as gopls is only used for devcontainer |
|
| 211 | 218 |
RUN --mount=type=cache,target=/root/.cache/go-build \ |
| 212 | 219 |
--mount=type=cache,target=/go/pkg/mod \ |
| 213 | 220 |
GOBIN=/build CGO_ENABLED=0 go install "golang.org/x/tools/gopls@latest" \ |
| ... | ... |
@@ -8,9 +8,11 @@ FROM golang:${GO_VERSION}-alpine AS base
|
| 8 | 8 |
WORKDIR /go/src/github.com/moby/moby |
| 9 | 9 |
RUN apk add --no-cache jq moreutils |
| 10 | 10 |
ARG GOVULNCHECK_VERSION |
| 11 |
+ADD https://github.com/golang/vuln.git?ref=${GOVULNCHECK_VERSION}&keep-git-dir=1 /go/src/golang.org/x/vuln
|
|
| 11 | 12 |
RUN --mount=type=cache,target=/root/.cache \ |
| 12 | 13 |
--mount=type=cache,target=/go/pkg/mod \ |
| 13 |
- go install golang.org/x/vuln/cmd/govulncheck@$GOVULNCHECK_VERSION |
|
| 14 |
+ cd /go/src/golang.org/x/vuln && \ |
|
| 15 |
+ go install ./cmd/govulncheck |
|
| 14 | 16 |
|
| 15 | 17 |
FROM base AS run |
| 16 | 18 |
ARG FORMAT |