Last active
May 28, 2019 13:04
-
-
Save harryadel/700d553b4188c7116c6d04ebee7728f0 to your computer and use it in GitHub Desktop.
docker-compose mongodb dump command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm --net ${network_name} --link ${container_name}:mongo -v $(pwd)/mongo-dump:/dump mongo bash -c 'mongodump --db xxxx -u xxxxx -p xxxxx --host ${container_name}' | |
# example | |
docker run --rm --net payslips_network --link pays_testing_database:mongo -v $(pwd)/mongo-dump:/dump mongo bash -c 'mongodump --db hrvj_db -u hrvj_user -p jd2jggPFCY4xuEuC --host pays_testing_database' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment