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}
2626# Run a gofmt and exclude all vendored code.
2727RUN 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; }
2828
29-
3029WORKDIR /go/src/handler/function
30+ RUN mkdir -p /go/src/handler/function/static
3131
3232RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test ./... -cover
3333
3434WORKDIR /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.14
38+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15
3939# Add non root user and certs
4040RUN apk --no-cache add ca-certificates \
4141 && addgroup -S app && adduser -S -g app app
@@ -46,9 +46,9 @@ RUN mkdir -p /home/app \
4646
4747WORKDIR /home/app
4848
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
5252
5353USER app
5454
Original file line number Diff line number Diff line change @@ -26,14 +26,16 @@ ENV CGO_ENABLED=${CGO_ENABLED}
2626RUN 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; }
2727
2828WORKDIR /go/src/handler/function
29+ RUN mkdir -p /go/src/handler/function/static
2930
3031RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test ./... -cover
3132
3233WORKDIR /go/src/handler
3334RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
3435 go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
3536
36- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.14
37+ FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15 as ship
38+
3739# Add non root user and certs
3840RUN apk --no-cache add ca-certificates \
3941 && addgroup -S app && adduser -S -g app app
@@ -44,9 +46,9 @@ RUN mkdir -p /home/app \
4446
4547WORKDIR /home/app
4648
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
5052
5153USER app
5254
You can’t perform that action at this time.
0 commit comments