-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Runtime stage - uses pre-built binary from GitHub Releases
FROM debian:stable-slim
ARG TARGETARCH
ARG VERSION
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
tar gzip ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1000 backitup
# Create directories
RUN mkdir -p /config /data /backups && \
chown -R backitup:backitup /config /data /backups
# Download and install binary
RUN set -eux; \
if [ -z "$VERSION" ]; then echo "VERSION argument is required"; exit 1; fi; \
case "${TARGETARCH}" in \
amd64) ARCH="x64" ;; \
arm64) ARCH="arm64" ;; \
*) echo "Unsupported architecture: ${TARGETARCH}"; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/climactic/backitup/releases/download/${VERSION}/backitup-linux-${ARCH}" -o /usr/local/bin/backitup && \
chmod +x /usr/local/bin/backitup
# Switch to non-root user
USER backitup
WORKDIR /app
# Default volumes
VOLUME ["/config", "/data", "/backups"]
ENTRYPOINT ["backitup"]
CMD ["--help"]