Skip to content

Commit f131de3

Browse files
committed
fix(dockerfile): install rustic in Dockerfile build
1 parent 01b59d7 commit f131de3

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

Dockerfile

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,35 @@
22
FROM golang:1.24-alpine AS builder
33

44
ARG VERSION
5+
ARG RUSTIC_VERSION=0.10.0
6+
ARG TARGETARCH
57
RUN apk add --update --no-cache git make mailcap curl bash
68
WORKDIR /app/
79
COPY go.mod go.sum /app/
810
RUN go mod download
911
COPY . /app/
10-
RUN make download-rustic
12+
13+
RUN case "$TARGETARCH" in \
14+
amd64) \
15+
ASSET="rustic-v${RUSTIC_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
16+
;; \
17+
arm64) \
18+
ASSET="rustic-v${RUSTIC_VERSION}-aarch64-unknown-linux-musl.tar.gz" \
19+
;; \
20+
*) \
21+
echo "Unsupported architecture: $TARGETARCH"; exit 1 \
22+
;; \
23+
esac && \
24+
mkdir -p /tmp/rustic && \
25+
curl -L https://github.com/rustic-rs/rustic/releases/download/v${RUSTIC_VERSION}/${ASSET} | tar -zx -C /tmp/rustic
26+
27+
1128
RUN CGO_ENABLED=0 go build \
12-
-ldflags="-s -w -X github.com/pyrohost/elytra/src/system.Version=$VERSION" \
13-
-v \
14-
-trimpath \
15-
-o elytra \
16-
./src/cmd/elytra
29+
-ldflags="-s -w -X github.com/pyrohost/elytra/src/system.Version=$VERSION" \
30+
-v \
31+
-trimpath \
32+
-o elytra \
33+
./src/cmd/elytra
1734
RUN echo "ID=\"distroless\"" > /etc/os-release
1835

1936
# Stage 2 (Final)
@@ -22,6 +39,7 @@ COPY --from=builder /etc/os-release /etc/os-release
2239
COPY --from=builder /etc/mime.types /etc/mime.types
2340

2441
COPY --from=builder /app/elytra /usr/bin/
42+
COPY --from=builder /tmp/rustic/rustic /usr/bin/
2543

2644
ENTRYPOINT ["/usr/bin/elytra"]
2745
CMD ["--config", "/etc/elytra/config.yml"]

0 commit comments

Comments
 (0)