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"]