-
Notifications
You must be signed in to change notification settings - Fork 208
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 871 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 871 Bytes
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
# mysql backup image
FROM golang:1.24.2-alpine3.21 AS build
COPY . /src/mysql-backup
WORKDIR /src/mysql-backup
RUN mkdir /out && go build -o /out/mysql-backup .
# we would do from scratch, but we need basic utilities in order to support pre/post scripts
FROM alpine:3.22 AS runtime
LABEL org.opencontainers.image.authors="https://github.com/databacker"
# set us up to run as non-root user
RUN apk add --no-cache bash tzdata && \
addgroup -g 1005 appuser && \
adduser -u 1005 -G appuser -D appuser
USER appuser
COPY --from=build /out/mysql-backup /mysql-backup
COPY entrypoint /entrypoint
ENV DB_DUMP_PRE_BACKUP_SCRIPTS="/scripts.d/pre-backup/"
ENV DB_DUMP_POST_BACKUP_SCRIPTS="/scripts.d/post-backup/"
ENV DB_DUMP_PRE_RESTORE_SCRIPTS="/scripts.d/pre-restore/"
ENV DB_DUMP_POST_RESTORE_SCRIPTS="/scripts.d/post-restore/"
# start
ENTRYPOINT ["/entrypoint"]