Last active
December 26, 2018 14:06
-
-
Save AlexVegner/51f2bd68af3c4ecdd3c08c46245b9f6d to your computer and use it in GitHub Desktop.
Docker notes
This file contains 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 kill $(docker ps -q) && \ | |
docker rm $(docker ps -a -q) |
This file contains 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
// Run container | |
docker run --name mongo-test-server -p 27017:27017 -v ~/data:/etc/mongo -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin -d mongo | |
// Connect to momgo | |
docker run -it --rm --link mongo-test-server:mongo mongo mongo --host mongo -u admin -p admin --authenticationDatabase admin todo | |
// Create db user | |
db.createUser( | |
{ | |
user: "dbUser", | |
pwd: "12345678", | |
roles: [ { role: "readWrite", db: "todo" }] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment