Compare commits

..

No commits in common. "d5d98e5a7c677b1f0ebdd8c6464ec2c54c4c24ba" and "8a403d725b59bcd48796b79e468a35d49b1b445e" have entirely different histories.

3 changed files with 4 additions and 11 deletions

View file

@ -12,7 +12,7 @@ ENV GO111MODULE=on
RUN go mod tidy RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /go/bin/dockerize . RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /go/bin/dockerize .
FROM alpine:3.21.0 FROM alpine:3.20.3
LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>" LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>"
RUN apk add --update \ RUN apk add --update \
@ -21,8 +21,7 @@ RUN apk add --update \
mysql-client \ mysql-client \
gzip \ gzip \
openssl \ openssl \
mariadb-connector-c \ mariadb-connector-c && \
fdupes && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/*
COPY --from=binary /go/bin/dockerize /usr/local/bin COPY --from=binary /go/bin/dockerize /usr/local/bin

View file

@ -42,7 +42,6 @@ Container is **Healthy** after the database init phase, that is after `INIT_BACK
- `GZIP_LEVEL`: Specify the level of gzip compression from 1 (quickest, least compressed) to 9 (slowest, most compressed), default is 6. - `GZIP_LEVEL`: Specify the level of gzip compression from 1 (quickest, least compressed) to 9 (slowest, most compressed), default is 6.
- `USE_PLAIN_SQL`: If set, back up and restore plain SQL files without gzip. - `USE_PLAIN_SQL`: If set, back up and restore plain SQL files without gzip.
- `TZ`: Specify TIMEZONE in Container. E.g. "Europe/Berlin". Default is UTC. - `TZ`: Specify TIMEZONE in Container. E.g. "Europe/Berlin". Default is UTC.
- `REMOVE_DUPLICATES`: Use [fdupes](https://github.com/adrianlopezroche/fdupes) to remove duplicate database dumps
If you want to make this image the perfect companion of your MySQL container, use [docker-compose](https://docs.docker.com/compose/). You can add more services that will be able to connect to the MySQL image using the name `my_mariadb`, note that you only expose the port `3306` internally to the servers and not to the host: If you want to make this image the perfect companion of your MySQL container, use [docker-compose](https://docs.docker.com/compose/). You can add more services that will be able to connect to the MySQL image using the name `my_mariadb`, note that you only expose the port `3306` internally to the servers and not to the host:

View file

@ -29,13 +29,13 @@ do
echo "==> Dumping database: $db" echo "==> Dumping database: $db"
FILENAME=/backup/$DATE.$db.sql FILENAME=/backup/$DATE.$db.sql
LATEST=/backup/latest.$db.sql LATEST=/backup/latest.$db.sql
if mysqldump --single-transaction --skip-comments $MYSQLDUMP_OPTS -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $MYSQL_SSL_OPTS "$db" > "$FILENAME" if mysqldump --single-transaction $MYSQLDUMP_OPTS -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $MYSQL_SSL_OPTS "$db" > "$FILENAME"
then then
EXT= EXT=
if [ -z "${USE_PLAIN_SQL}" ] if [ -z "${USE_PLAIN_SQL}" ]
then then
echo "==> Compressing $db with LEVEL $GZIP_LEVEL" echo "==> Compressing $db with LEVEL $GZIP_LEVEL"
gzip "-$GZIP_LEVEL" -n -f "$FILENAME" gzip "-$GZIP_LEVEL" -f "$FILENAME"
EXT=.gz EXT=.gz
FILENAME=$FILENAME$EXT FILENAME=$FILENAME$EXT
LATEST=$LATEST$EXT LATEST=$LATEST$EXT
@ -44,11 +44,6 @@ do
echo "==> Creating symlink to latest backup: $BASENAME" echo "==> Creating symlink to latest backup: $BASENAME"
rm "$LATEST" 2> /dev/null rm "$LATEST" 2> /dev/null
cd /backup || exit && ln -s "$BASENAME" "$(basename "$LATEST")" cd /backup || exit && ln -s "$BASENAME" "$(basename "$LATEST")"
if [ -n "$REMOVE_DUPLICATES" ]
then
echo "=> Removing duplicate database dumps"
fdupes -idN /backup/
fi
if [ -n "$MAX_BACKUPS" ] if [ -n "$MAX_BACKUPS" ]
then then
# Execute the delete script, delete older backup or other custom delete script # Execute the delete script, delete older backup or other custom delete script