Debian slim + mongorestore + AWS CLI docker image for Kubernetes; rigged up to backup mongodb, a single database, or a single collection to an s3 bucket
This docker image contains:
- Debian slim Slim
- MongoDB Community Edition
- AWS CLI
AWS_S3_URI
- the S3 URI to the archive to restore
MONGO_URI
- specifies the resolvable URI connection string of the MongoDB deploymentMONGORESTORE_DB
- specifies the destination database to restore into when restoring from a BSON fileMONGORESTORE_COLLECTION
- specifies the name of the destination collection to restore data into when restoring from a BSON fileMONGORESTORE_NS_EXCLUDE
- --nsExcludeMONGORESTORE_NS_INCLUDE
- --nsIncludeMONGORESTORE_NS_FROM
- --nsFromMONGORESTORE_NS_TO
- --nsToMONGORESTORE_DROP
- string 'true' to enable --dropMONGORESTORE_DRYRUN
- string 'true' to enable --dryRunMONGORESTORE_OPLOGREPLAY
- string 'true' to enable --oplogReplayMONGORESTORE_NUM_PARALLEL
- number of parallel connections numParallelCollectionsMONGORESTORE_NUM_INSERTWORKERS
- number of insertion workers numInsertionWorkersPerCollectionMONGORESTORE_GZIP
- restores from compressed files --gzipMONGORESTORE_ARCHIVE
- archive filename input from an archive fileMONGORESTORE_BATCHSIZE
- --batchsize (undocumented) - Mongorestore uses huge amount of RAM
Pass in the following environment variables for AWS CLI credientals.
AWS_ACCESS_KEY_ID
– Specifies an AWS access key associated with an IAM user or role.AWS_SECRET_ACCESS_KEY
– Specifies the secret key associated with the access key. This is essentially the "password" for the access key.AWS_DEFAULT_REGION
– Specifies the AWS Region to send the request to.AWS_PROFILE
- specifies a pre-configured AWS profile - see AWS CLI docs
For more options you can configure with environment variables refer to: AWS Environment Variables