Skip to content

Commit 126b43a

Browse files
committed
build: include rustic in the container for elytra.
1 parent ee25402 commit 126b43a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Dockerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@ ARG TARGETOS=linux
66
ARG 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
1212
WORKDIR /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
1529
COPY go.mod go.sum ./
1630
RUN go mod download && go mod verify
@@ -38,8 +52,9 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3852
COPY --from=builder /etc/mime.types /etc/mime.types
3953
COPY --from=builder /etc/os-release /etc/os-release
4054

41-
# Copy the binary
55+
# Copy the binaries
4256
COPY --from=builder /app/elytra /usr/bin/elytra
57+
COPY --from=builder /usr/local/bin/rustic /usr/bin/rustic
4358

4459
# Use non-root user
4560
USER nonroot:nonroot

0 commit comments

Comments
 (0)