This repository has been archived by the owner on Jan 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steffen Bleul
committed
Oct 5, 2016
1 parent
a53f7d1
commit a843cd0
Showing
8 changed files
with
124 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
FROM blacklabelops/centos:7.2.1511 | ||
FROM blacklabelops/alpine | ||
MAINTAINER Steffen Bleul <[email protected]> | ||
|
||
# rsnapshot version (e.g. 1.4.2-r0) | ||
ARG RSNAPSHOT_VERSION=latest | ||
|
||
# install rsnapshot | ||
COPY configuration/rsnapshot.conf /etc/rsnapshot.conf | ||
COPY imagescripts/docker-entrypoint.sh /usr/bin/rsnapshot.d/docker-entrypoint.sh | ||
COPY imagescripts/rsnapshot.sh /usr/bin/rsnapshot.d/rsnapshot.sh | ||
COPY configuration/rsnapshot.conf.default /etc/rsnapshot.conf | ||
COPY imagescripts /usr/bin/rsnapshot.d | ||
|
||
RUN yum install -y epel-release && \ | ||
yum install -y rsnapshot-1.3.1 && \ | ||
yum clean all && rm -rf /var/cache/yum/* && \ | ||
RUN apk upgrade --update && \ | ||
if [ "${RSNAPSHOT_VERSION}" = "latest" ]; \ | ||
then apk add rsnapshot ; \ | ||
else apk add "rsnapshot=${RSNAPSHOT_VERSION}" ; \ | ||
fi && \ | ||
mkdir -p /usr/bin/rsnapshot.d && \ | ||
cp /etc/rsnapshot.conf /usr/bin/rsnapshot.d/rsnapshot.conf && \ | ||
chmod ug+x /usr/bin/rsnapshot.d/*.sh | ||
chmod ug+x /usr/bin/rsnapshot.d/*.sh && \ | ||
rm -rf /var/cache/apk/* && rm -rf /tmp/* | ||
|
||
ENV BACKUP_INTERVAL= \ | ||
BACKUP_DIRECTORIES= \ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,10 @@ | |
# rsnapshot.conf - rsnapshot configuration file # | ||
################################################# | ||
# # | ||
# PLEASE BE AWARE OF THE FOLLOWING RULES: # | ||
# PLEASE BE AWARE OF THE FOLLOWING RULE: # | ||
# # | ||
# This file requires tabs between elements # | ||
# # | ||
# Directories require a trailing slash: # | ||
# right: /home/ # | ||
# wrong: /home # | ||
# # | ||
################################################# | ||
|
||
####################### | ||
|
@@ -41,11 +37,11 @@ snapshot_root /snapshots/ | |
# | ||
# See the README file or the man page for more details. | ||
# | ||
cmd_cp /usr/bin/cp | ||
#cmd_cp /bin/cp | ||
|
||
# uncomment this to use the rm program instead of the built-in perl routine. | ||
# | ||
cmd_rm /usr/bin/rm | ||
cmd_rm /bin/rm | ||
|
||
# rsync must be enabled for anything to work. This is the only command that | ||
# must be enabled. | ||
|
@@ -58,13 +54,13 @@ cmd_rsync /usr/bin/rsync | |
|
||
# Comment this out to disable syslog support. | ||
# | ||
# cmd_logger /usr/bin/logger | ||
#cmd_logger /usr/bin/logger | ||
|
||
# Uncomment this to specify the path to "du" for disk usage checks. | ||
# If you have an older version of "du", you may also want to check the | ||
# "du_args" parameter below. | ||
# | ||
cmd_du /usr/bin/du | ||
#cmd_du /usr/bin/du | ||
|
||
# Uncomment this to specify the path to rsnapshot-diff. | ||
# | ||
|
@@ -80,16 +76,24 @@ cmd_du /usr/bin/du | |
# | ||
#cmd_postexec /path/to/postexec/script | ||
|
||
# Paths to lvcreate, lvremove, mount and umount commands, for use with | ||
# Linux LVMs. | ||
# | ||
#linux_lvm_cmd_lvcreate /path/to/lvcreate | ||
#linux_lvm_cmd_lvremove /path/to/lvremove | ||
#linux_lvm_cmd_mount /bin/mount | ||
#linux_lvm_cmd_umount /bin/umount | ||
|
||
######################################### | ||
# BACKUP INTERVALS # | ||
# BACKUP LEVELS / INTERVALS # | ||
# Must be unique and in ascending order # | ||
# i.e. hourly, daily, weekly, etc. # | ||
# e.g. alpha, beta, gamma, etc. # | ||
######################################### | ||
|
||
#interval hourly 6 | ||
#interval daily 7 | ||
#interval weekly 4 | ||
#interval monthly 1 | ||
#retain alpha 6 | ||
#retain beta 7 | ||
#retain gamma 4 | ||
#retain delta 3 | ||
|
||
############################################ | ||
# GLOBAL OPTIONS # | ||
|
@@ -113,14 +117,20 @@ loglevel 3 | |
# If you enable this, data will be written to the file you specify. The | ||
# amount of data written is controlled by the "loglevel" parameter. | ||
# | ||
# logfile /var/log/rsnapshot.log | ||
#logfile /var/log/rsnapshot | ||
|
||
# If enabled, rsnapshot will write a lockfile to prevent two instances | ||
# from running simultaneously (and messing up the snapshot_root). | ||
# If you enable this, make sure the lockfile directory is not world | ||
# writable. Otherwise anyone can prevent the program from running. | ||
# | ||
lockfile /usr/bin/rsnapshot.d/rsnapshot.pid | ||
lockfile /var/run/rsnapshot.pid | ||
|
||
# By default, rsnapshot check lockfile, check if PID is running | ||
# and if not, consider lockfile as stale, then start | ||
# Enabling this stop rsnapshot if PID in lockfile is not running | ||
# | ||
#stop_on_stale_lockfile 0 | ||
|
||
# Default rsync args. All rsync commands have at least these options set. | ||
# | ||
|
@@ -160,15 +170,15 @@ lockfile /usr/bin/rsnapshot.d/rsnapshot.pid | |
#include_file /path/to/include/file | ||
#exclude_file /path/to/exclude/file | ||
|
||
# If your version of rsync supports --link-dest, consider enable this. | ||
# If your version of rsync supports --link-dest, consider enabling this. | ||
# This is the best way to support special files (FIFOs, etc) cross-platform. | ||
# The default is 0 (off). | ||
# | ||
#link_dest 0 | ||
|
||
# When sync_first is enabled, it changes the default behaviour of rsnapshot. | ||
# Normally, when rsnapshot is called with its lowest interval | ||
# (i.e.: "rsnapshot hourly"), it will sync files AND rotate the lowest | ||
# (i.e.: "rsnapshot alpha"), it will sync files AND rotate the lowest | ||
# intervals. With sync_first enabled, "rsnapshot sync" handles the file sync, | ||
# and all interval calls simply rotate files. See the man page for more | ||
# details. The default is 0 (off). | ||
|
@@ -182,12 +192,32 @@ lockfile /usr/bin/rsnapshot.d/rsnapshot.pid | |
#use_lazy_deletes 0 | ||
|
||
# Number of rsync re-tries. If you experience any network problems or | ||
# network card issues that tend to cause ssh to crap-out with | ||
# "Corrupted MAC on input" errors, for example, set this to a non-zero | ||
# value to have the rsync operation re-tried | ||
# network card issues that tend to cause ssh to fail with errors like | ||
# "Corrupted MAC on input", for example, set this to a non-zero value | ||
# to have the rsync operation re-tried. | ||
# | ||
#rsync_numtries 0 | ||
|
||
# LVM parameters. Used to backup with creating lvm snapshot before backup | ||
# and removing it after. This should ensure consistency of data in some special | ||
# cases | ||
# | ||
# LVM snapshot(s) size (lvcreate --size option). | ||
# | ||
#linux_lvm_snapshotsize 100M | ||
|
||
# Name to be used when creating the LVM logical volume snapshot(s). | ||
# | ||
#linux_lvm_snapshotname rsnapshot | ||
|
||
# Path to the LVM Volume Groups. | ||
# | ||
#linux_lvm_vgpath /dev | ||
|
||
# Mount point to use to temporarily mount the snapshot(s). | ||
# | ||
#linux_lvm_mountpath /path/to/mount/lvm/snapshot/during/backup | ||
|
||
############################### | ||
### BACKUP POINTS / SCRIPTS ### | ||
############################### | ||
|
@@ -201,14 +231,16 @@ lockfile /usr/bin/rsnapshot.d/rsnapshot.pid | |
#backup /home/foo/My Documents/ localhost/ | ||
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog | ||
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/ | ||
# You must set linux_lvm_* parameters below before using lvm snapshots | ||
#backup lvm://vg0/xen-home/ lvm-vg0/xen-home/ | ||
|
||
# EXAMPLE.COM | ||
#backup_script /bin/date "+ backup of example.com started at %c" unused1 | ||
#backup_exec /bin/date "+ backup of example.com started at %c" | ||
#backup [email protected]:/home/ example.com/ +rsync_long_args=--bwlimit=16,exclude=core | ||
#backup [email protected]:/etc/ example.com/ exclude=mtab,exclude=core | ||
#backup_script ssh [email protected] "mysqldump -A > /var/db/dump/mysql.sql" unused2 | ||
#backup_exec ssh [email protected] "mysqldump -A > /var/db/dump/mysql.sql" | ||
#backup [email protected]:/var/db/dump/ example.com/ | ||
#backup_script /bin/date "+ backup of example.com ended at %c" unused9 | ||
#backup_exec /bin/date "+ backup of example.com ended at %c" | ||
|
||
# CVS.SOURCEFORGE.NET | ||
#backup_script /usr/local/bin/backup_rsnapshot_cvsroot.sh rsnapshot.cvs.sourceforge.net/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,53 @@ | ||
FROM blacklabelops/rsnapshot:alpine | ||
FROM blacklabelops/rsnapshot | ||
MAINTAINER Steffen Bleul <[email protected]> | ||
|
||
#Permissions, set the linux user id and group id | ||
ARG CONTAINER_UID=1000 | ||
ARG CONTAINER_GID=1000 | ||
# build parameters | ||
ARG JOBBER_VERSION=latest | ||
|
||
# install Jobber | ||
ENV JOBBER_HOME=/opt/jobber | ||
ENV JOBBER_LIB=$JOBBER_HOME/lib | ||
ENV GOPATH=$JOBBER_LIB | ||
|
||
RUN export CONTAINER_USER=jenkins && \ | ||
export CONTAINER_GROUP=jenkins && \ | ||
# Add user | ||
addgroup -g $CONTAINER_GID jobber_client && \ | ||
adduser -u $CONTAINER_UID -G jobber_client -s /bin/bash -S jobber_client && \ | ||
# Instll Jobber | ||
RUN export JOBBER_HOME=/tmp/jobber && \ | ||
export JOBBER_LIB=$JOBBER_HOME/lib && \ | ||
export GOPATH=$JOBBER_LIB && \ | ||
export CONTAINER_UID=1000 && \ | ||
export CONTAINER_GID=1000 && \ | ||
export CONTAINER_USER=jobber_client && \ | ||
export CONTAINER_GROUP=jobber_client && \ | ||
# Install tools | ||
apk add --update \ | ||
go \ | ||
make \ | ||
git && \ | ||
git \ | ||
curl \ | ||
wget \ | ||
make && \ | ||
mkdir -p $JOBBER_HOME && \ | ||
mkdir -p $JOBBER_LIB && \ | ||
# Install Jobber | ||
addgroup -g $CONTAINER_GID jobber_client && \ | ||
adduser -u $CONTAINER_UID -G jobber_client -s /bin/bash -S jobber_client && \ | ||
cd $JOBBER_LIB && \ | ||
go get github.com/dshearer/jobber && \ | ||
make -C src/github.com/dshearer/jobber build DESTDIR=$JOBBER_HOME && \ | ||
if [ "${JOBBER_VERSION}" != "latest" ]; \ | ||
then \ | ||
# wget --directory-prefix=/tmp https://github.com/dshearer/jobber/releases/download/v1.1/jobber-${JOBBER_VERSION}-r0.x86_64.apk && \ | ||
# apk add --allow-untrusted /tmp/jobber-${JOBBER_VERSION}-r0.x86_64.apk ; \ | ||
cd src/github.com/dshearer/jobber && \ | ||
git checkout tags/${JOBBER_VERSION} && \ | ||
cd $JOBBER_LIB ; \ | ||
fi && \ | ||
make -C src/github.com/dshearer/jobber install DESTDIR=$JOBBER_HOME && \ | ||
cp $JOBBER_LIB/bin/* /usr/bin && \ | ||
# Install Tini Zombie Reaper And Signal Forwarder | ||
export TINI_VERSION=0.9.0 && \ | ||
export TINI_SHA=fa23d1e20732501c3bb8eeeca423c89ac80ed452 && \ | ||
curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static -o /bin/tini && \ | ||
chmod +x /bin/tini && \ | ||
# Cleanup | ||
apk del \ | ||
go \ | ||
make \ | ||
git && \ | ||
rm -rf /var/cache/apk/* && rm -rf /tmp/* | ||
git \ | ||
curl \ | ||
wget \ | ||
make && \ | ||
rm -rf /var/cache/apk/* && rm -rf /tmp/* && rm -rf /var/log/* | ||
|
||
ENV PATH=$PATH:/opt/jobber/lib/bin \ | ||
CRON_HOURLY= \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -x | ||
|
||
#------------------ | ||
# CONTAINER VARIABLES | ||
#------------------ | ||
export RSNAPSHOT_VERSION=1.4.2-r0 |