File tree Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1- FROM --platform=${TARGETPLATFORM:-linux/amd64} openfaas/of-watchdog:0.8.0 as watchdog
2- FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.15-alpine3.12 as build
1+ FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/ openfaas/of-watchdog:0.8.3 as watchdog
2+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.15-alpine3.13 as build
33
44ARG TARGETPLATFORM
55ARG BUILDPLATFORM
@@ -27,11 +27,13 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
2727 go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
2828RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test handler/function/... -cover
2929
30- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.12
30+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.13
3131# Add non root user and certs
3232RUN apk --no-cache add ca-certificates \
33- && addgroup -S app && adduser -S -g app app \
34- && mkdir -p /home/app \
33+ && addgroup -S app && adduser -S -g app app
34+ # Split instructions so that buildkit can run & cache
35+ # the previous command ahead of time.
36+ RUN mkdir -p /home/app \
3537 && chown app /home/app
3638
3739WORKDIR /home/app
@@ -47,5 +49,6 @@ USER app
4749ENV fprocess="./handler"
4850ENV mode="http"
4951ENV upstream_url="http://127.0.0.1:8082"
52+ ENV prefix_logs="false"
5053
5154CMD ["./fwatchdog" ]
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
1111func Handle (req handler.Request ) (handler.Response , error ) {
1212 var err error
1313
14- message := fmt .Sprintf ("Hello world, input was : %s" , string (req .Body ))
14+ message := fmt .Sprintf ("Body : %s" , string (req .Body ))
1515
1616 return handler.Response {
1717 Body : []byte (message ),
Original file line number Diff line number Diff line change 11module handler
22
3- go 1.13
3+ go 1.15
44
55replace handler/function => ./function
66
Original file line number Diff line number Diff line change 1- FROM --platform=${TARGETPLATFORM:-linux/amd64} openfaas/of-watchdog:0.8.0 as watchdog
2- FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.15-alpine3.12 as build
1+ FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/ openfaas/of-watchdog:0.8.3 as watchdog
2+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.15-alpine3.13 as build
33
44ARG TARGETPLATFORM
55ARG BUILDPLATFORM
@@ -35,11 +35,13 @@ WORKDIR /go/src/handler
3535RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
3636 go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
3737
38- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.12
38+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.13
3939# Add non root user and certs
4040RUN apk --no-cache add ca-certificates \
41- && addgroup -S app && adduser -S -g app app \
42- && mkdir -p /home/app \
41+ && addgroup -S app && adduser -S -g app app
42+ # Split instructions so that buildkit can run & cache
43+ # the previous command ahead of time.
44+ RUN mkdir -p /home/app \
4345 && chown app /home/app
4446
4547WORKDIR /home/app
@@ -53,5 +55,6 @@ USER app
5355ENV fprocess="./handler"
5456ENV mode="http"
5557ENV upstream_url="http://127.0.0.1:8082"
58+ ENV prefix_logs="false"
5659
5760CMD ["./fwatchdog" ]
Original file line number Diff line number Diff line change @@ -18,5 +18,5 @@ func Handle(w http.ResponseWriter, r *http.Request) {
1818 }
1919
2020 w .WriteHeader (http .StatusOK )
21- w .Write ([]byte (fmt .Sprintf ("Hello world, input was : %s" , string (input ))))
21+ w .Write ([]byte (fmt .Sprintf ("Body : %s" , string (input ))))
2222}
Original file line number Diff line number Diff line change 11module handler
22
3- go 1.13
3+ go 1.15
44
55replace handler/function => ./function
You can’t perform that action at this time.
0 commit comments