forked from benjamin-maynard/kubernetes-cloud-mysql-backup
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
39 lines (34 loc) · 1.13 KB
/
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
38
39
# Set the base image to MySQL 8.3.0, which uses microdnf
FROM mysql:8.3.0
# Install additional required packages
USER root
RUN microdnf update && \
microdnf install -y \
python3-pip \
less \
mailcap \
curl \
gnupg \
gzip \
git \
go && \
pip3 install --upgrade awscli s3cmd python-magic && \
microdnf clean all
# Set Default Environment Variables
ENV BACKUP_CREATE_DATABASE_STATEMENT=false \
TARGET_DATABASE_PORT=3306 \
CLOUD_SDK_VERSION=367.0.0 \
# Release commit for https://github.com/FiloSottile/age
AGE_VERSION=552aa0a07de0b42c16126d3107bd8895184a69e7
# Install FiloSottile/age for encryption, adjusting for the go environment
RUN git clone https://github.com/FiloSottile/age.git /tmp/age && \
cd /tmp/age && \
git checkout $AGE_VERSION && \
go build -o . ./cmd/age && \
cp age /usr/local/bin/ && \
rm -rf /tmp/age
# Assume you have a backup script that uses mysqldump, awscli, etc.
COPY resources/perform-backup.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/perform-backup.sh
# Set the entrypoint to execute the backup script
CMD ["/usr/local/bin/perform-backup.sh"]