File tree Expand file tree Collapse file tree 3 files changed +22
-24
lines changed Expand file tree Collapse file tree 3 files changed +22
-24
lines changed Original file line number Diff line number Diff line change 11build
22test
33test.yml
4+
5+ template
Original file line number Diff line number Diff line change 1- FROM golang:1.9.2 -alpine3.6
1+ FROM golang:1.10.4 -alpine3.8 as build
22
3- # Alternatively use ADD https:// (which will not be cached by Docker builder)
43RUN apk --no-cache add curl \
54 && echo "Pulling watchdog binary from Github." \
65 && curl -sSLf https://github.com/openfaas-incubator/of-watchdog/releases/download/0.4.0/of-watchdog > /usr/bin/fwatchdog \
@@ -18,19 +17,18 @@ RUN CGO_ENABLED=0 GOOS=linux \
1817 go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
1918 go test $(go list ./... | grep -v /vendor/) -cover
2019
21- FROM alpine:3.6
22- RUN apk --no-cache add ca-certificates
23-
24- # Add non root user
25- RUN addgroup -S app && adduser -S -g app app
26- RUN mkdir -p /home/app
27- RUN chown app /home/app
20+ FROM alpine:3.8
21+ # Add non root user and certs
22+ RUN apk --no-cache add ca-certificates \
23+ && addgroup -S app && adduser -S -g app app \
24+ && mkdir -p /home/app \
25+ && chown app /home/app
2826
2927WORKDIR /home/app
3028
31- COPY --from=0 /go/src/handler/handler .
32- COPY --from=0 /usr/bin/fwatchdog .
33- # RUN apk add --no-cache curl
29+ COPY --from=build /go/src/handler/handler .
30+ COPY --from=build /usr/bin/fwatchdog .
31+
3432USER app
3533
3634ENV fprocess="./handler"
Original file line number Diff line number Diff line change 1- FROM golang:1.10.4-alpine3.8
1+ FROM golang:1.10.4-alpine3.8 as build
22
3- # Alternatively use ADD https:// (which will not be cached by Docker builder)
43RUN apk --no-cache add curl \
54 && echo "Pulling watchdog binary from Github." \
6- && curl -sSLf https://github.com/openfaas-incubator/of-watchdog/releases/download/0.2.7 /of-watchdog > /usr/bin/fwatchdog \
5+ && curl -sSLf https://github.com/openfaas-incubator/of-watchdog/releases/download/0.4.0 /of-watchdog > /usr/bin/fwatchdog \
76 && chmod +x /usr/bin/fwatchdog \
87 && apk del curl --no-cache
98
@@ -19,18 +18,17 @@ RUN CGO_ENABLED=0 GOOS=linux \
1918 go test $(go list ./... | grep -v /vendor/) -cover
2019
2120FROM alpine:3.8
22- RUN apk --no-cache add ca-certificates
23-
24- # Add non root user
25- RUN addgroup -S app && adduser -S -g app app
26- RUN mkdir -p /home/app
27- RUN chown app /home/app
21+ # Add non root user and certs
22+ RUN apk --no-cache add ca-certificates \
23+ && addgroup -S app && adduser -S -g app app \
24+ && mkdir -p /home/app \
25+ && chown app /home/app
2826
2927WORKDIR /home/app
3028
31- COPY --from=0 /go/src/handler/handler .
32- COPY --from=0 /usr/bin/fwatchdog .
33- # RUN apk add --no-cache curl
29+ COPY --from=build /go/src/handler/handler .
30+ COPY --from=build /usr/bin/fwatchdog .
31+
3432USER app
3533
3634ENV fprocess="./handler"
You can’t perform that action at this time.
0 commit comments