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
3
3
4
4
ARG TARGETPLATFORM
5
5
ARG BUILDPLATFORM
@@ -27,11 +27,13 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
27
27
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
28
28
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test handler/function/... -cover
29
29
30
- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.12
30
+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.13
31
31
# Add non root user and certs
32
32
RUN 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 \
35
37
&& chown app /home/app
36
38
37
39
WORKDIR /home/app
@@ -47,5 +49,6 @@ USER app
47
49
ENV fprocess="./handler"
48
50
ENV mode="http"
49
51
ENV upstream_url="http://127.0.0.1:8082"
52
+ ENV prefix_logs="false"
50
53
51
54
CMD ["./fwatchdog" ]
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
11
11
func Handle (req handler.Request ) (handler.Response , error ) {
12
12
var err error
13
13
14
- message := fmt .Sprintf ("Hello world, input was : %s" , string (req .Body ))
14
+ message := fmt .Sprintf ("Body : %s" , string (req .Body ))
15
15
16
16
return handler.Response {
17
17
Body : []byte (message ),
Original file line number Diff line number Diff line change 1
1
module handler
2
2
3
- go 1.13
3
+ go 1.15
4
4
5
5
replace handler/function => ./function
6
6
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
3
3
4
4
ARG TARGETPLATFORM
5
5
ARG BUILDPLATFORM
@@ -35,11 +35,13 @@ WORKDIR /go/src/handler
35
35
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
36
36
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
37
37
38
- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.12
38
+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.13
39
39
# Add non root user and certs
40
40
RUN 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 \
43
45
&& chown app /home/app
44
46
45
47
WORKDIR /home/app
@@ -53,5 +55,6 @@ USER app
53
55
ENV fprocess="./handler"
54
56
ENV mode="http"
55
57
ENV upstream_url="http://127.0.0.1:8082"
58
+ ENV prefix_logs="false"
56
59
57
60
CMD ["./fwatchdog" ]
Original file line number Diff line number Diff line change @@ -18,5 +18,5 @@ func Handle(w http.ResponseWriter, r *http.Request) {
18
18
}
19
19
20
20
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 ))))
22
22
}
Original file line number Diff line number Diff line change 1
1
module handler
2
2
3
- go 1.13
3
+ go 1.15
4
4
5
5
replace handler/function => ./function
You can’t perform that action at this time.
0 commit comments