Skip to content

Commit 6d038a3

Browse files
committed
Add modules to Docker build
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent a722f52 commit 6d038a3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ COPY vendor vendor
1717
COPY handler handler
1818
COPY version version
1919
COPY nats nats
20-
COPY main.go .
21-
COPY types.go .
22-
COPY readconfig.go .
20+
COPY go.mod .
21+
COPY go.sum .
22+
COPY main.go .
23+
COPY types.go .
24+
COPY auth.go .
25+
COPY .git .
26+
COPY readconfig.go .
2327
COPY readconfig_test.go .
24-
COPY auth.go .
25-
COPY .git .
2628

2729
ARG go_opts
2830

@@ -32,7 +34,7 @@ RUN VERSION=$(git describe --all --exact-match `git rev-parse HEAD` | grep tags
3234
--ldflags "-s -w \
3335
-X github.com/openfaas/nats-queue-worker/version.GitCommit=${GIT_COMMIT}\
3436
-X github.com/openfaas/nats-queue-worker/version.Version=${VERSION}" \
35-
-a -installsuffix cgo -o app .
37+
-a -installsuffix cgo -o worker .
3638

3739
# we can't add user in next stage because it's from scratch
3840
# ca-certificates and tmp folder are also missing in scratch
@@ -41,5 +43,5 @@ FROM --platform=${BUILDPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot
4143

4244
WORKDIR /
4345
USER nonroot:nonroot
44-
COPY --from=build /go/src/github.com/openfaas/nats-queue-worker/app .
45-
CMD ["./app"]
46+
COPY --from=build /go/src/github.com/openfaas/nats-queue-worker/worker .
47+
CMD ["/worker"]

0 commit comments

Comments
 (0)