Skip to content

Backups streaming to S3 via s3gof3r in Docker

License

Notifications You must be signed in to change notification settings

Schlepptop/docker-s3backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-s3backup

dokku/s3backup

Info

Docker image that creates and streams a tar backup of a host volume to Amazon S3 storage.

  • Lightweight: Based on the Alpine base image
  • Fast: Backups are streamed directly to S3 with awscli
  • Versatile: Can also be used with selfhosted S3-compatible services like minio

Usage

Run the automated build, specifying your AWS credentials, bucket name, and backup path.

docker run -it \
      -e AWS_ACCESS_KEY_ID=ID \
      -e AWS_SECRET_ACCESS_KEY=KEY \
      -e BUCKET_NAME=backups \
      -e BACKUP_NAME=backup \
      -v /path/to/backup:/backup dokku/s3backup

Advanced Usage

Example with different region, different S3 storage class, different signature version and call to S3-compatible service (different endpoint url)

docker run -it \
      -e AWS_ACCESS_KEY_ID=ID \
      -e AWS_SECRET_ACCESS_KEY=KEY \
      -e AWS_DEFAULT_REGION=us-east-1 \
      -e AWS_SIGNATURE_VERSION=s3v4 \
      -e S3_STORAGE_CLASS=STANDARD_IA \
      -e ENDPOINT_URL=https://YOURAPIURL \
      -e BUCKET_NAME=backups \
      -e BACKUP_NAME=backup \
      -v /path/to/backup:/backup dokku/s3backup

Encryption

You can optionally encrypt your backup using GnuPG. To do so, set ENCRYPTION_KEY.

docker run -it \
      -e AWS_ACCESS_KEY_ID=ID \
      -e AWS_SECRET_ACCESS_KEY=KEY \
      -e BUCKET_NAME=backups \
      -e BACKUP_NAME=backup \
      -e ENCRYPTION_KEY=your_secret_passphrase
      -v /path/to/backup:/backup dokku/s3backup

Building

First, build the image.

docker build -t s3backup .

Then run the image, specifying your AWS credentials, bucket name, and backup path.

docker run -it \
      -e AWS_ACCESS_KEY_ID=ID \
      -e AWS_SECRET_ACCESS_KEY=KEY \
      -e BUCKET_NAME=backups \
      -e BACKUP_NAME=backup \
      -v /path/to/backup:/backup s3backup

About

Backups streaming to S3 via s3gof3r in Docker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 77.4%
  • Dockerfile 22.6%