mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
Dockerfile: add GO_SWAGGER_VERSION build-arg
Allow overriding the go-swagger version to install.
With this patch:
docker build -q --call=outline --target=swagger .
TARGET: swagger
BUILD ARG VALUE DESCRIPTION
GO_VERSION 1.24.5
BASE_DEBIAN_DISTRO bookworm
GOLANG_IMAGE golang:1.24.5-bookworm
XX_VERSION 1.6.1
GO_SWAGGER_VERSION v0.32.3 specifies the version of the go-swagger binary to install.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -84,11 +84,15 @@ RUN mkdir /build && mv /bin/registry /build/registry
|
||||
FROM base AS swagger
|
||||
WORKDIR /go/src/github.com/go-swagger/go-swagger
|
||||
ARG TARGETPLATFORM
|
||||
# GO_SWAGGER_VERSION specifies the version of the go-swagger binary to install.
|
||||
# Go-swagger is used in CI for generating types from swagger.yaml in
|
||||
# hack/validate/swagger-gen
|
||||
ARG GO_SWAGGER_VERSION=v0.32.3
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build,id=swagger-build-$TARGETPLATFORM \
|
||||
--mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=tmpfs,target=/go/src/ <<EOT
|
||||
set -e
|
||||
GOBIN=/build xx-go install github.com/go-swagger/go-swagger/cmd/swagger@v0.32.3
|
||||
GOBIN=/build xx-go install "github.com/go-swagger/go-swagger/cmd/swagger@${GO_SWAGGER_VERSION}"
|
||||
xx-verify /build/swagger
|
||||
EOT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user