A docker image to restore a MongoDB database archive from Google Cloud Storage.
The container runs mongorestore
to restore a gzipped archive (--gzip --archive
) pulled from GS to a running Docker container hosting the MongoDB server. The archive has the database name embedded.
This image is a compliment to https://github.com/tmannherz/docker-mongo-gce-backup.
MONGO_HOST
- Host of running MongoDB instanceGS_PROJECT_ID
- GCE project IDGS_SERVICE_EMAIL
- Email of service account to useGS_RESTORE_BUCKET
- Cloud storage bucket pull fromGS_RESTORE_FILE
- Archive file name to restore
The restore script expects a service account auth JSON file in /restore/service-account.json
.
docker run --name restore \
-v service-account.json:/restore/service-account.json:ro \
-e MONGO_HOST=db \
-e GS_PROJECT_ID=my-project \
-e GS_SERVICE_EMAIL=email@proj.iam.gserviceaccount.com \
-e GS_RESTORE_BUCKET=my-bucket \
-e GS_RESTORE_FILE=backup.archive.gz \
--network default \
--link service_db:db \
tmannherz/mongo-gce-restore