From ffda6ab323dbf5c6c4e72c70e1da58ab6a2de457 Mon Sep 17 00:00:00 2001 From: Tom Gamble Date: Tue, 24 Sep 2024 16:25:43 -0700 Subject: [PATCH] update go versions and dockerfile template (#387) --- template/dockerfiles/go/Dockerfile | 2 +- template/dockerfiles/go/draft.yaml | 4 ++-- template/dockerfiles/gomodule/Dockerfile | 6 ++++-- template/dockerfiles/gomodule/draft.yaml | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/template/dockerfiles/go/Dockerfile b/template/dockerfiles/go/Dockerfile index aa359511..368c9086 100644 --- a/template/dockerfiles/go/Dockerfile +++ b/template/dockerfiles/go/Dockerfile @@ -1,5 +1,5 @@ FROM golang:{{.VERSION}} -ENV PORT {{.PORT}} +ENV PORT={{.PORT}} EXPOSE {{.PORT}} WORKDIR /go/src/app diff --git a/template/dockerfiles/go/draft.yaml b/template/dockerfiles/go/draft.yaml index 0523c3e0..f7ef7c58 100644 --- a/template/dockerfiles/go/draft.yaml +++ b/template/dockerfiles/go/draft.yaml @@ -14,6 +14,6 @@ variables: type: "string" kind: "containerImageVersion" default: - value: "1.18" + value: "1.23" description: "the version of go used by the application" - exampleValues: ["1.16", "1.17", "1.18", "1.19"] + exampleValues: ["1.20", "1.21", "1.22", "1.23"] diff --git a/template/dockerfiles/gomodule/Dockerfile b/template/dockerfiles/gomodule/Dockerfile index 57c1f48e..15ba241b 100644 --- a/template/dockerfiles/gomodule/Dockerfile +++ b/template/dockerfiles/gomodule/Dockerfile @@ -1,6 +1,4 @@ FROM golang:{{.VERSION}} AS builder -ENV PORT {{.PORT}} -EXPOSE {{.PORT}} WORKDIR /build COPY go.mod go.sum ./ @@ -9,6 +7,10 @@ COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -v -o app-binary FROM gcr.io/distroless/static-debian12 + +ENV PORT={{.PORT}} +EXPOSE {{.PORT}} + WORKDIR /app COPY --from=builder /build/app-binary . CMD ["/app/app-binary"] diff --git a/template/dockerfiles/gomodule/draft.yaml b/template/dockerfiles/gomodule/draft.yaml index 0978b0d3..55991a10 100644 --- a/template/dockerfiles/gomodule/draft.yaml +++ b/template/dockerfiles/gomodule/draft.yaml @@ -14,6 +14,6 @@ variables: type: "string" kind: "containerImageVersion" default: - value: "1.18" + value: "1.23" description: "the version of go used by the application" - exampleValues: ["1.16", "1.17", "1.18", "1.19"] + exampleValues: ["1.20", "1.21", "1.22", "1.23"]