Skip to content

Commit e490943

Browse files
committed
Update to Go 1.19 and Alpine 3.17
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 4c89dc9 commit e490943

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

template/golang-http/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.10 as watchdog
2-
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.18-alpine3.16 as build
1+
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.11 as watchdog
2+
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as build
33

44
ARG TARGETPLATFORM
55
ARG BUILDPLATFORM
@@ -22,7 +22,6 @@ ARG GOFLAGS=""
2222
ARG CGO_ENABLED=0
2323
ENV CGO_ENABLED=${CGO_ENABLED}
2424

25-
2625
# Run a gofmt and exclude all vendored code.
2726
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }
2827

@@ -38,10 +37,12 @@ WORKDIR /go/src/handler
3837
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOFLAGS=${GOFLAGS} \
3938
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
4039

41-
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.16.2 as ship
40+
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.17.1 as ship
4241
# Add non root user and certs
42+
4343
RUN apk --no-cache add ca-certificates \
4444
&& addgroup -S app && adduser -S -g app app
45+
4546
# Split instructions so that buildkit can run & cache
4647
# the previous command ahead of time.
4748
RUN mkdir -p /home/app \

template/golang-http/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: golang-http
22
fprocess: ./handler
33
welcome_message: |
4-
You have created a new function which uses Go 1.18 and Alpine
4+
You have created a new function which uses Go 1.19 and Alpine
55
Linux as its base image.
66
77
To disable the go module, for private vendor code, please use

template/golang-middleware/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.10 as watchdog
2-
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.18-alpine3.16 as build
1+
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.11 as watchdog
2+
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine as build
33

44
ARG TARGETPLATFORM
55
ARG BUILDPLATFORM
@@ -34,11 +34,12 @@ WORKDIR /go/src/handler
3434
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
3535
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
3636

37-
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.16.2 as ship
37+
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.17.1 as ship
3838

3939
# Add non root user and certs
4040
RUN apk --no-cache add ca-certificates \
4141
&& addgroup -S app && adduser -S -g app app
42+
4243
# Split instructions so that buildkit can run & cache
4344
# the previous command ahead of time.
4445
RUN mkdir -p /home/app \

template/golang-middleware/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: golang-middleware
22
fprocess: ./handler
33
welcome_message: |
4-
You have created a new function which uses Go 1.18 and Alpine
4+
You have created a new function which uses Go 1.19 and Alpine
55
Linux as its base image.
66
77
To disable the go module, for private vendor code, please use

0 commit comments

Comments
 (0)