Compare commits

...

7 Commits
1.16 ... 1.17.0

Author SHA1 Message Date
Dave Conroy
d7bdcbd0dc Release 1.17.0 - See CHANGELOG.md 2019-12-09 13:58:11 -08:00
Dave Conroy
62ee7ad3dc Update README.md 2019-10-19 09:09:25 -07:00
Dave Conroy
65c879172f Fix docker-compose.yml example 2019-10-19 09:08:20 -07:00
Dave Conroy
33c942551a Merge pull request #18 from alwynpan/1.16.1
Fix couchdb backup endpoint; Set ENABLE_ZABBIX to FALSE by default
2019-10-01 18:22:55 -07:00
Yao (Alwyn) Pan
36e4d9a2a2 Fix couchdb backup endpoint; Set ENABLE_ZABBIX to FALSE by default 2019-10-02 10:27:26 +10:00
Dave Conroy
aa1c8b3591 Merge pull request #16 from tito/tito-patch-1
Fix usage of DB_PORT for single mariadb database
2019-09-16 07:12:54 -07:00
Mathieu Virbel
243bbb9709 Fix usage of DB_PORT for single mariadb database
Fixes #15
2019-09-16 12:32:16 +02:00
6 changed files with 53 additions and 56 deletions

View File

@@ -1,3 +1,10 @@
## 1.17.0 2019-12-09 <dave at tiredofit dot ca>
### Changed
- Stop compiling mongodb-tools as it is back in Alpine:edge repositories
- Cleanup Code
## 1.16 - 2019-06-16 - <dave at tiredofit dot ca>
* Check to see if Database Exists before performing backup

View File

@@ -1,59 +1,51 @@
FROM tiredofit/mongo-builder as mongo-packages
FROM tiredofit/alpine:edge
LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)"
### Copy Mongo Packages
COPY --from=mongo-packages / /usr/src/apk
### Set Environment Variables
ENV ENABLE_CRON=FALSE \
ENABLE_SMTP=FALSE
ENV ENABLE_CRON=FALSE \
ENABLE_SMTP=FALSE \
ENABLE_ZABBIX=FALSE \
ZABBIX_HOSTNAME=db-backup
### Dependencies
RUN set -ex && \
echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add --virtual .db-backup-build-deps \
build-base \
bzip2-dev \
git \
xz-dev \
&& \
\
apk add -t .db-backup-run-deps \
bzip2 \
influxdb \
mariadb-client \
libressl \
pigz \
postgresql \
postgresql-client \
redis \
xz \
&& \
apk add \
pixz@testing \
&& \
\
## Locally Install Mongo Package
cd /usr/src/apk && \
apk add -t .db-backup-mongo-deps --allow-untrusted \
mongodb-tools*.apk \
&& \
\
cd /usr/src && \
mkdir -p pbzip2 && \
curl -ssL https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz | tar xvfz - --strip=1 -C /usr/src/pbzip2 && \
cd pbzip2 && \
make && \
make install && \
\
RUN set -ex && \
echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add -t .db-backup-build-deps \
build-base \
bzip2-dev \
git \
xz-dev \
&& \
\
apk add -t .db-backup-run-deps \
bzip2 \
influxdb \
mariadb-client \
mongodb-tools \
libressl \
pigz \
postgresql \
postgresql-client \
redis \
xz \
&& \
\
apk add \
pixz@testing \
&& \
\
mkdir -p /usr/src/pbzip2 && \
curl -ssL https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz | tar xvfz - --strip=1 -C /usr/src/pbzip2 && \
cd /usr/src/pbzip2 && \
make && \
make install && \
\
### Cleanup
rm -rf /usr/src/* && \
apk del .db-backup-build-deps && \
rm -rf /tmp/* /var/cache/apk/*
apk del .db-backup-build-deps && \
rm -rf /usr/src/* && \
rm -rf /tmp/* /var/cache/apk/*
### S6 Setup
ADD install /

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Dave Conroy
Copyright (c) 2019 Dave Conroy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -6,7 +6,6 @@
[![Docker Stars](https://img.shields.io/docker/stars/tiredofit/db-backup.svg)](https://hub.docker.com/r/tiredofit/db-backup)
[![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/db-backup.svg)](https://microbadger.com/images/tiredofit/db-backup)
# Introduction
This will build a container for backing up multiple type of DB Servers
@@ -23,7 +22,7 @@ Currently backs up CouchDB, InfluxDB, MySQL, MongoDB Postgres, Redis, Rethink se
* select how often to run a dump
* select when to start the first dump, whether time of day or relative to container start time
* This Container uses a [customized Alpine Linux base](https://hub.docker.com/r/tiredofit/alpine) which includes [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 Init capabilities, [zabbix-agent](https://zabbix.org) based on `3.4` compiled for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, nano, vim) for easier management. It also supports sending to external SMTP servers
* This Container uses a [customized Alpine Linux base](https://hub.docker.com/r/tiredofit/alpine) which includes [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 Init capabilities, [zabbix-agent](https://zabbix.org) for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, nano, vim) for easier management. It also supports sending to external SMTP servers.
[Changelog](CHANGELOG.md)

View File

@@ -19,7 +19,7 @@ services:
links:
- example-db
volumes:
- ./backups:/backups
- ./backups:/backup
environment:
- DB_TYPE=mariadb
- DB_HOST=example-db
@@ -32,7 +32,6 @@ services:
- MD5=TRUE
- COMPRESSION=XZ
- SPLIT_DB=FALSE
restart: always

View File

@@ -97,7 +97,7 @@ fi
### Functions
function backup_couch() {
TARGET=couch_${DBNAME}_${DBHOST}_${now}.txt
curl -X GET http://${DBHOST}:${DBPORT}/${DBNAME}/ all docs? include docs=true >${TMPDIR}/${TARGET}
curl -X GET http://${DBHOST}:${DBPORT}/${DBNAME}/_all_docs?include_docs=true >${TMPDIR}/${TARGET}
generate_md5
compression
move_backup
@@ -118,7 +118,7 @@ function backup_mysql() {
fi
done
else
mysqldump --max-allowed-packet=512M -A -h $DBHOST -u$DBUSER ${MYSQL_PASS_STR} > ${TMPDIR}/${TARGET}
mysqldump --max-allowed-packet=512M -A -h $DBHOST -P $DBPORT -u$DBUSER ${MYSQL_PASS_STR} > ${TMPDIR}/${TARGET}
generate_md5
compression
move_backup