Repository navigation
Expand file tree
/
Copy pathDockerfile.agent
More file actions
49 lines (38 loc) · 2.2 KB
/
Copy pathDockerfile.agent
File metadata and controls
49 lines (38 loc) · 2.2 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
# syntax=docker/dockerfile:1
# fallbck-agent: backup worker that talks to the FallBCK server (REST + Temporal gRPC via
# the server's gateway) through a single server URL. Two targets:
# slim (ghcr.io/fallbck/agent:latest) filesystem, Proxmox VE, Docker host and git repository jobs
# tools (ghcr.io/fallbck/agent:tools) slim plus the PostgreSQL, MariaDB and MongoDB client
# tools, so the same agent runs database jobs
# Built by GoReleaser (dockers_v2, one entry per target) from the prebuilt
# $TARGETPLATFORM/fallbck-agent.
# ---- mariadb-binlog ------------------------------------------------------------
# Alpine ships mariadb-binlog only inside the (large) mariadb server package; take the
# single binary from it so binary-log fetching works without the server.
FROM alpine:3.24 AS mariadb-tools
RUN apk add --no-cache mariadb
# ---- Runtime stage: slim -----------------------------------------------------
FROM alpine:3.24 AS slim
# git and git-lfs mirror repositories for git repository (VCS) jobs
RUN apk add --no-cache ca-certificates tzdata git git-lfs
RUN addgroup -S fallbck && adduser -S -G fallbck -u 10002 fallbck && \
mkdir -p /var/lib/fallbck/agent /backup-data && \
chown -R fallbck:fallbck /var/lib/fallbck /backup-data
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/fallbck-agent /usr/local/bin/fallbck-agent
USER fallbck
# The image owns the binary: the agent reports it cannot self-update
ENV FALLBCK_AGENT_DATA_DIR=/var/lib/fallbck/agent FALLBCK_IN_CONTAINER=1
VOLUME ["/var/lib/fallbck/agent", "/backup-data"]
ENTRYPOINT ["/usr/local/bin/fallbck-agent"]
CMD ["run"]
# ---- Runtime stage: tools ----------------------------------------------------
# Alpine 3.21 ships PostgreSQL 17 client tools (pg_dump must be at least as new as the
# server it dumps), MariaDB client tools and MongoDB Database Tools 100.x. The agent
# detects them and reports db_tools, which lets the server assign database jobs to it.
FROM slim AS tools
USER root
RUN apk add --no-cache postgresql17-client mariadb-client mongodb-tools
COPY --from=mariadb-tools /usr/bin/mariadb-binlog /usr/bin/mariadb-binlog
RUN ln -s mariadb-binlog /usr/bin/mysqlbinlog && mariadb-binlog --version
USER fallbck