File tree 3 files changed +22
-24
lines changed
3 files changed +22
-24
lines changed Original file line number Diff line number Diff line change 1
1
build
2
2
test
3
3
test.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
2
2
3
- # Alternatively use ADD https:// (which will not be cached by Docker builder)
4
3
RUN apk --no-cache add curl \
5
4
&& echo "Pulling watchdog binary from Github." \
6
5
&& 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 \
18
17
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
19
18
go test $(go list ./... | grep -v /vendor/) -cover
20
19
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
28
26
29
27
WORKDIR /home/app
30
28
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
+
34
32
USER app
35
33
36
34
ENV 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
2
2
3
- # Alternatively use ADD https:// (which will not be cached by Docker builder)
4
3
RUN apk --no-cache add curl \
5
4
&& 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 \
7
6
&& chmod +x /usr/bin/fwatchdog \
8
7
&& apk del curl --no-cache
9
8
@@ -19,18 +18,17 @@ RUN CGO_ENABLED=0 GOOS=linux \
19
18
go test $(go list ./... | grep -v /vendor/) -cover
20
19
21
20
FROM 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
28
26
29
27
WORKDIR /home/app
30
28
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
+
34
32
USER app
35
33
36
34
ENV fprocess="./handler"
You can’t perform that action at this time.
0 commit comments