Skip to content

Commit 5fdf40f

Browse files
Fix compose logs
1 parent 82eae79 commit 5fdf40f

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

debian/Dockerfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ RUN test -n "${VERSION}" || (echo "Error: VERSION is not set" && exit 1)
77
ARG ARCH
88
RUN test -n "${ARCH}" || (echo "Error: ARCH is not set" && exit 1)
99

10-
COPY . /app
10+
# Download dependencies first (this layer will be cached by docker for quicker image builds).
11+
# This will be recomputed only when these two files change, instead of every build.
12+
COPY go.mod go.sum* /app/
1113
WORKDIR /app
12-
RUN export VERSION=$(echo "${VERSION}" | sed -e "s/^v\(.*\)/\1/") && \
13-
GOOS=linux GOARCH=${ARCH} go build -ldflags "-X 'main.Version=${VERSION}'" -o ${BINARY_NAME} ./cmd/${BINARY_NAME}
14+
15+
RUN --mount=type=cache,target=/go/pkg/mod,sharing=locked \
16+
go mod download
17+
18+
ADD cmd ./cmd
19+
ADD internal ./internal
20+
ADD pkg ./pkg
21+
22+
RUN --mount=type=cache,target=/go/pkg/mod,sharing=locked \
23+
--mount=type=cache,target=/root/.cache/go-build,sharing=locked \
24+
export VERSION=$(echo "${VERSION}" | sed -e "s/^v\(.*\)/\1/") \
25+
&& GOOS=linux GOARCH=${ARCH} go build -ldflags "-X 'main.Version=${VERSION}'" -o ${BINARY_NAME} ./cmd/${BINARY_NAME}
1426

1527
FROM debian:bookworm AS debian
1628

debian/arduino-router/usr/share/doc/arduino-router/copyright

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Apache License
227227
Cobra is released under the Apache 2.0 license. See [LICENSE.txt](LICENSE.txt)
228228

229229
*****
230-
github.com/spf13/pflag@v1.0.6
230+
github.com/spf13/pflag@v1.0.7
231231

232232
Copyright (c) 2012 Alex Ogier. All rights reserved.
233233
Copyright (c) 2012 The Go Authors. All rights reserved.

0 commit comments

Comments
 (0)