This commit is contained in:
1 parent
3e8f3aabbe
commit
7827b3208b
1 file changed
+10
-8
+10
-8
@@ -1,28 +1,30 @@
|
||||
# Stage 1: build - NO LONGER NEEDED!
|
||||
|
||||
# Use a slim base image directly
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Define the version of Rustic to install as a build argument
|
||||
ARG RUSTIC_VERSION=v0.10.0
|
||||
|
||||
# Set DEBIAN_FRONTEND to noninteractive to suppress warnings during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install runtime dependencies and download binaries in a single layer
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
cron bash curl tzdata ca-certificates && \
|
||||
\
|
||||
# --- Install Rustic ---
|
||||
# Download the statically compiled (musl) version for maximum portability.
|
||||
# The version is controlled by the RUSTIC_VERSION build argument.
|
||||
curl -L -o rustic.tar.gz https://github.com/rustic-rs/rustic/releases/download/${RUSTIC_VERSION}/rustic-${RUSTIC_VERSION}-x86_64-unknown-linux-musl.tar.gz && \
|
||||
tar -xvzf rustic.tar.gz && \
|
||||
mv rustic-${RUSTIC_VERSION}-x86_64-unknown-linux-musl/rustic /usr/local/bin/rustic && \
|
||||
# Download and extract the rustic binary directly into /usr/local/bin in one command.
|
||||
# - The pipe `|` sends the downloaded archive directly to tar.
|
||||
# - `tar -xvzf -` reads the archive from standard input.
|
||||
# - `-C /usr/local/bin` tells tar to extract into the target directory.
|
||||
# - `rustic` at the end tells tar to only extract that specific file.
|
||||
curl -L https://github.com/rustic-rs/rustic/releases/download/${RUSTIC_VERSION}/rustic-${RUSTIC_VERSION}-x86_64-unknown-linux-musl.tar.gz \
|
||||
| tar -xvzf - -C /usr/local/bin rustic && \
|
||||
\
|
||||
# --- Install MinIO Client (mc) ---
|
||||
curl -o /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc && \
|
||||
\
|
||||
# --- Set Permissions & Clean Up ---
|
||||
chmod +x /usr/local/bin/rustic /usr/local/bin/mc && \
|
||||
rm -rf rustic.tar.gz rustic-v* && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy our custom scripts into the image
|
||||
|
||||
Reference in new issue
Block a user