File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
arduino-router/usr/share/doc/arduino-router Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,22 @@ RUN test -n "${VERSION}" || (echo "Error: VERSION is not set" && exit 1)
77ARG ARCH
88RUN 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/
1113WORKDIR /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
1527FROM debian:bookworm AS debian
1628
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ Apache License
227227Cobra 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
232232Copyright (c) 2012 Alex Ogier. All rights reserved.
233233Copyright (c) 2012 The Go Authors. All rights reserved.
You can’t perform that action at this time.
0 commit comments