A container to be used in an Docker EE environment. It runs a scheduled backup through cron and uploads the backup tar file to an S3 bucket.
git clone https://github.com/pvdbleek/ucp-backup
The default schedule in the Dockerfile is every night at 1.10AM. You might want to adjust that to your preferred time.
docker build -t <namespace>/<repository> .
docker push <namespace>/<repository>
Assuming you know how to set up an S3 bucket and IAM access: Create two secrets in swarm:
echo <your_aws_access_key> | docker secret create aws_access_key -
echo <your_aws_secret_key> | docker secret create aws_secret_key -
Make sure to use the following constraint:
node.role==manager
Bind mount the Docker socket on:
/var/run/docker.sock
Mount /etc/localtime to the container so that we use the same timezone as the host.
Expose the following two environment variables to your service:
AWS_REGION = <the_aws_region_your_s3_account_lives>
AWS_BUCKET = <the_name_of_your_s3_bucket>