From 30b53f352b9aab5df472be215656736ccb30a35b Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:21:05 +0200 Subject: [PATCH] [chore] bump go swagger version in build (#2292) --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c1cce4d2..8cf8ee3cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,21 @@ # Dockerfile reference: https://docs.docker.com/engine/reference/builder/ # stage 1: generate up-to-date swagger.yaml to put in the final container -FROM --platform=${BUILDPLATFORM} quay.io/goswagger/swagger:v0.30.4 AS swagger +FROM --platform=${BUILDPLATFORM} golang:1.21-alpine AS swagger + +RUN \ + ### Installs goswagger for building swagger definitions inside this container + go install "github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5" && \ + # Makes swagger executable + chmod +x /go/bin/swagger COPY go.mod /go/src/github.com/superseriousbusiness/gotosocial/go.mod COPY go.sum /go/src/github.com/superseriousbusiness/gotosocial/go.sum COPY cmd /go/src/github.com/superseriousbusiness/gotosocial/cmd COPY internal /go/src/github.com/superseriousbusiness/gotosocial/internal + WORKDIR /go/src/github.com/superseriousbusiness/gotosocial -RUN swagger generate spec -o /go/src/github.com/superseriousbusiness/gotosocial/swagger.yaml --scan-models +RUN /go/bin/swagger generate spec -o /go/src/github.com/superseriousbusiness/gotosocial/swagger.yaml --scan-models # stage 2: generate the web/assets/dist bundles FROM --platform=${BUILDPLATFORM} node:18-alpine AS bundler