File tree Expand file tree Collapse file tree 5 files changed +23
-47
lines changed Expand file tree Collapse file tree 5 files changed +23
-47
lines changed Original file line number Diff line number Diff line change 1
- FROM alpine:latest
2
- LABEL maintainer="Johannes Schickling <schickling.j@gmail.com>"
3
-
4
- ADD install.sh install.sh
5
- RUN sh install.sh && rm install.sh
1
+ FROM debian:latest
6
2
7
3
ENV MYSQLDUMP_OPTIONS --quote-names --quick --add-drop-table --add-locks --allow-keywords --disable-keys --extended-insert --single-transaction --create-options --comments --net_buffer_length=16384
8
- ENV MYSQLDUMP_DATABASE --all-databases
4
+ ENV MYSQLDUMP_DATABASE **None**
9
5
ENV MYSQL_HOST **None**
10
6
ENV MYSQL_PORT 3306
11
7
ENV MYSQL_USER **None**
@@ -19,9 +15,17 @@ ENV S3_S3V4 no
19
15
ENV S3_PREFIX 'backup'
20
16
ENV S3_FILENAME **None**
21
17
ENV MULTI_FILES no
22
- ENV SCHEDULE **None**
23
18
24
- ADD run.sh run.sh
25
- ADD backup.sh backup.sh
19
+ # install mysqldump, pip, awscli
20
+ RUN apt-get update && \
21
+ apt-get install -y mariadb-client-10.3 python3 python3-pip && \
22
+ pip3 install awscli && \
23
+ apt-get autoremove -y && \
24
+ apt-get remove -y python3-pip && \
25
+ apt-get clean && \
26
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
27
+
28
+ ADD run.sh backup.sh /
29
+ RUN chmod +x /run.sh /backup.sh
26
30
27
- CMD ["sh" , "run.sh" ]
31
+ CMD ["sh" , "/ run.sh" ]
Original file line number Diff line number Diff line change 2
2
3
3
# mysql-backup-s3
4
4
5
- Backup MySQL to S3 (supports periodic backups & mutli files)
5
+ Backup MySQL to S3 (supports periodic backups & mutli files).
6
+
7
+ Updated to use a Debian base image with the latest MySQL Client tools, removed support for ` SCHEDULE ` using go-cron.
6
8
7
9
## Basic usage
8
10
@@ -27,10 +29,4 @@ $ docker run -e S3_ACCESS_KEY_ID=key -e S3_SECRET_ACCESS_KEY=secret -e S3_BUCKET
27
29
- ` S3_ENDPOINT ` the AWS Endpoint URL, for S3 Compliant APIs such as [ minio] ( https://minio.io ) (default: none)
28
30
- ` S3_S3V4 ` set to ` yes ` to enable AWS Signature Version 4, required for [ minio] ( https://minio.io ) servers (default: no)
29
31
- ` MULTI_FILES ` Allow to have one file per database if set ` yes ` default: no)
30
- - ` SCHEDULE ` backup schedule time, see explainatons below
31
-
32
- ### Automatic Periodic Backups
33
-
34
- You can additionally set the ` SCHEDULE ` environment variable like ` -e SCHEDULE="@daily" ` to run the backup automatically.
35
32
36
- More information about the scheduling can be found [ here] ( http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules ) .
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ if [ "${S3_BUCKET}" == "**None**" ]; then
15
15
exit 1
16
16
fi
17
17
18
+ if [ " ${MYSQLDUMP_DATABASE} " == " **None**" ]; then
19
+ echo " You need to set the MYSQLDUMP_DATABASE environment variable (database name OR --all-databases)."
20
+ exit 1
21
+ fi
22
+
18
23
if [ " ${MYSQL_HOST} " == " **None**" ]; then
19
24
echo " You need to set the MYSQL_HOST environment variable."
20
25
exit 1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,8 +6,4 @@ if [ "${S3_S3V4}" = "yes" ]; then
6
6
aws configure set default.s3.signature_version s3v4
7
7
fi
8
8
9
- if [ " ${SCHEDULE} " = " **None**" ]; then
10
- sh backup.sh
11
- else
12
- exec go-cron " $SCHEDULE " /bin/sh backup.sh
13
- fi
9
+ sh backup.sh
You can’t perform that action at this time.
0 commit comments