File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change 22FROM golang:1.24-alpine AS builder
33
44ARG VERSION
5+ ARG RUSTIC_VERSION=0.10.0
6+ ARG TARGETARCH
57RUN apk add --update --no-cache git make mailcap curl bash
68WORKDIR /app/
79COPY go.mod go.sum /app/
810RUN go mod download
911COPY . /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+
1128RUN 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
1734RUN echo "ID=\" distroless\" " > /etc/os-release
1835
1936# Stage 2 (Final)
@@ -22,6 +39,7 @@ COPY --from=builder /etc/os-release /etc/os-release
2239COPY --from=builder /etc/mime.types /etc/mime.types
2340
2441COPY --from=builder /app/elytra /usr/bin/
42+ COPY --from=builder /tmp/rustic/rustic /usr/bin/
2543
2644ENTRYPOINT ["/usr/bin/elytra" ]
2745CMD ["--config" , "/etc/elytra/config.yml" ]
You can’t perform that action at this time.
0 commit comments