-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (27 loc) · 805 Bytes
/
Dockerfile
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
FROM alpine:3.15 AS base
RUN apk --update add \
tzdata \
bash \
tar \
pigz \
coreutils \
mysql-client \
mariadb-connector-c \
openssl \
logrotate \
&& rm -rf /var/cache/apk/* \
&& mkdir /backup \
&& chmod 755 /backup
COPY ./src/ /usr/local/bin
COPY ./logrotate.d/* /etc/logrotate.d/
CMD [ "run-cron" ]
FROM base AS test
COPY --from=trajano/alpine-libfaketime /faketime.so /lib/faketime.so
ENV LD_PRELOAD=/lib/faketime.so
RUN apk add shellcheck make \
&& mkdir -p /usr/src/secure-mysql-backups
COPY ./src/ /usr/src/secure-mysql-backups/src/
COPY ./test/ /usr/src/secure-mysql-backups/test/
COPY ./Makefile /usr/src/secure-mysql-backups
WORKDIR /usr/src/secure-mysql-backups
CMD [ "tail", "-f", "/dev/null" ]