Hello world for MongoDB with go
The purpose of this tutorial is to execute a simple command on a MongoDB database.
Requirements
You need first to have a MongoDB service available. More information here
Build and run
Once you have created your user, and set up your IP restrictions you can run the following:
read USER
read -s PASSWORD
read URI
docker build -t mongodb-go-hello-world .
docker run mongodb-go-hello-world "$(echo -n $URI | sed "s/<username>/$USER/" | sed "s/<password>/$PASSWORD/")"