Repository navigation
Expand file tree
/
Copy pathContainerfile
More file actions
71 lines (61 loc) · 2.88 KB
/
Copy pathContainerfile
File metadata and controls
71 lines (61 loc) · 2.88 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.j2
# --------------------------------------------------------------------------
ARG BASE_VERSION=15.1
FROM ghcr.io/daemonless/base-exec:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PACKAGES="rclone restic ca_root_nss"
ARG APP_VERSION=""
ARG UPSTREAM_URL="https://api.github.com/repos/garethgeorge/backrest/releases/latest"
ARG UPSTREAM_JQ=".tag_name"
# --- Metadata (Injected by Generator) ---
LABEL org.opencontainers.image.title="Backrest" \
org.opencontainers.image.description="Backrest is a web-accessible backup solution built on top of restic. Backrest provides a WebUI which wraps the restic CLI and makes it easy to create repos, browse snapshots, and restore files. Additionally, Backrest can run in the background and take an opinionated approach to scheduling snapshots and orchestrating repo health operations." \
org.opencontainers.image.source="https://github.com/daemonless/backrest" \
org.opencontainers.image.url="https://garethgeorge.github.io/backrest" \
org.opencontainers.image.licenses="GPL-3.0-only" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="Utilities" \
io.daemonless.port="9898" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.pkg-source="upstream" \
io.daemonless.upstream-url="${UPSTREAM_URL}" \
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
io.daemonless.packages="${PACKAGES}"
# Install dependencies
RUN pkg update && \
pkg install -y ${PACKAGES} && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
# Download and install Backrest from official GitHub release
RUN if [ -z "${APP_VERSION}" ]; then \
APP_VERSION=$(fetch -qo - "${UPSTREAM_URL}" | jq -r "${UPSTREAM_JQ}"); \
fi && \
CLEAN_VER="${APP_VERSION#v}" && \
case "${FREEBSD_ARCH}" in \
amd64) ARCH_SUFFIX="x86_64" ;; \
aarch64) ARCH_SUFFIX="arm64" ;; \
*) echo "Unsupported arch ${FREEBSD_ARCH}" && exit 1 ;; \
esac && \
TARBALL="backrest_Freebsd_${ARCH_SUFFIX}.tar.gz" && \
DOWNLOAD_URL="https://github.com/garethgeorge/backrest/releases/download/${APP_VERSION}/${TARBALL}" && \
echo "Downloading Backrest ${CLEAN_VER} from ${DOWNLOAD_URL}" && \
fetch -qo /tmp/backrest.tar.gz "${DOWNLOAD_URL}" && \
tar -xzf /tmp/backrest.tar.gz -C /usr/local/bin backrest && \
chmod 755 /usr/local/bin/backrest && \
rm /tmp/backrest.tar.gz && \
mkdir -p /app && \
echo "${CLEAN_VER}" > /app/version
# Copy root filesystem
COPY root/ /
RUN chmod +x /daemonless/libexec/backrest /daemonless/init.d/*
CMD ["/daemonless/libexec/backrest"]
# Set permissions
RUN chmod +x /healthz
# Expose
EXPOSE 9898
# Volumes
VOLUME /config /data