File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,16 @@ ENV CGO_ENABLED=${CGO_ENABLED}
26
26
# Run a gofmt and exclude all vendored code.
27
27
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; }
28
28
29
-
30
29
WORKDIR /go/src/handler/function
30
+ RUN mkdir -p /go/src/handler/function/static
31
31
32
32
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test ./... -cover
33
33
34
34
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.14
38
+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15
39
39
# Add non root user and certs
40
40
RUN apk --no-cache add ca-certificates \
41
41
&& addgroup -S app && adduser -S -g app app
@@ -46,9 +46,9 @@ RUN mkdir -p /home/app \
46
46
47
47
WORKDIR /home/app
48
48
49
- COPY --from=build --chown=app /go/src/handler/handler .
50
- COPY --from=build --chown=app /usr/bin/fwatchdog .
51
- COPY --from=build --chown=app /go/src/handler/function/ .
49
+ COPY --from=build --chown=app /go/src/handler/handler .
50
+ COPY --from=build --chown=app /usr/bin/fwatchdog .
51
+ COPY --from=build --chown=app /go/src/handler/function/static static
52
52
53
53
USER app
54
54
Original file line number Diff line number Diff line change @@ -26,14 +26,16 @@ ENV CGO_ENABLED=${CGO_ENABLED}
26
26
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; }
27
27
28
28
WORKDIR /go/src/handler/function
29
+ RUN mkdir -p /go/src/handler/function/static
29
30
30
31
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test ./... -cover
31
32
32
33
WORKDIR /go/src/handler
33
34
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
34
35
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
35
36
36
- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.14
37
+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15 as ship
38
+
37
39
# Add non root user and certs
38
40
RUN apk --no-cache add ca-certificates \
39
41
&& addgroup -S app && adduser -S -g app app
@@ -44,9 +46,9 @@ RUN mkdir -p /home/app \
44
46
45
47
WORKDIR /home/app
46
48
47
- COPY --from=build --chown=app /go/src/handler/handler .
48
- COPY --from=build --chown=app /usr/bin/fwatchdog .
49
- COPY --from=build --chown=app /go/src/handler/function/ .
49
+ COPY --from=build --chown=app /go/src/handler/handler .
50
+ COPY --from=build --chown=app /usr/bin/fwatchdog .
51
+ COPY --from=build --chown=app /go/src/handler/function/static static
50
52
51
53
USER app
52
54
You can’t perform that action at this time.
0 commit comments