Sign inSign up

cycloid/mysql-dump

By cycloid

Updated about 1 month ago

Image
0

100K+

cycloid/mysql-dump repository overview

mysql-dump

Based on https://github.com/talset/docker-mysql-backup-s3

container to backup and restore your mysql database's to using awscli. Could be use with docker or in k8s.

Container startup explained

  • This container user cron to make backups
  • Mysql will dump the database to this container and compress it using gzip
  • Using s3cli the file will be uploaded to S3 Storage
  • To restore a db just enter the container and run the 'restore' script with the s3 path of the dump you want to restore :
./restore path/inside-bucket/example.sql.gz
  • To run a manual backup just enter the container and run:
./backup

Configure

Env var nameDescription
MYSQL_HOSTHost where MySQL is running. default localhost. example with k8s $(MYSQL_SERVICE_HOST)
MYSQL_TCP_PORTPort to connect to MySQL. default 3306. example with k8s $(MYSQL_SERVICE_PORT)
MYSQL_USERThe username to connect with MySQL
MYSQL_PWDThe password to connect with MySQL
MYSQL_DATABASEDatabase used
FILENAMEName to file in bucket storage. Default name backup_%Y-%m-%d_%H-%M-%S output example backup_2015-08-03_17-58-22
BACKUP_DIRInternal pod directory to use when creating the backup, this directory can be mouted via a volume if necessary
BACKUP_TIMETime use crontab format to run a dump. default 0 5 * * * (5 am)
AWS_ACCESS_KEY_IDAWS access key ID (used to access to the S3 bucket)
AWS_SECRET_ACCESS_KEYAWS secret access key
AWS_S3_BUCKETAWS S3 bucket to store the PostgreSQL dumps
AWS_DEFAULT_REGIONAWS region of the S3 bucket
SCW_ACCESS_KEYSCW access key (used to access to the Scaleway Object Storage bucket)
SCW_SECRET_KEYSCW secret key
SCW_DEFAULT_ORGANIZATION_IDSCW default organization ID
SCW_DEFAULT_REGIONSCW region of the Object Storage bucket

Build

sudo docker build -t cycloid/mysql-dump .
sudo docker push cycloid/mysql-dump

Tag summary

Content type

Image

Digest

sha256:a6c451d89

Size

499 MB

Last updated

11 months ago

docker pull cycloid/mysql-dump