File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,25 @@ ARG TARGETOS=linux
66ARG TARGETARCH=amd64
77
88# Install build dependencies
9- RUN apk add --update --no-cache git make ca-certificates tzdata mailcap
9+ RUN apk add --update --no-cache git make ca-certificates tzdata mailcap curl
1010
1111# Set working directory
1212WORKDIR /app
1313
14+ # Download and install Rustic
15+ ARG RUSTIC_VERSION=v0.9.5
16+ RUN case "${TARGETARCH}" in \
17+ "amd64" ) RUSTIC_ARCH="x86_64" ;; \
18+ "arm64" ) RUSTIC_ARCH="aarch64" ;; \
19+ *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
20+ esac && \
21+ curl -L "https://github.com/rustic-rs/rustic/releases/download/${RUSTIC_VERSION}/rustic-${RUSTIC_VERSION}-${RUSTIC_ARCH}-unknown-linux-musl.tar.gz" \
22+ -o rustic.tar.gz && \
23+ tar -xzf rustic.tar.gz && \
24+ mv rustic /usr/local/bin/rustic && \
25+ chmod +x /usr/local/bin/rustic && \
26+ rm rustic.tar.gz
27+
1428# Copy go mod files first for better caching
1529COPY go.mod go.sum ./
1630RUN go mod download && go mod verify
@@ -38,8 +52,9 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3852COPY --from=builder /etc/mime.types /etc/mime.types
3953COPY --from=builder /etc/os-release /etc/os-release
4054
41- # Copy the binary
55+ # Copy the binaries
4256COPY --from=builder /app/elytra /usr/bin/elytra
57+ COPY --from=builder /usr/local/bin/rustic /usr/bin/rustic
4358
4459# Use non-root user
4560USER nonroot:nonroot
You can’t perform that action at this time.
0 commit comments