Skip to content

Instantly share code, notes, and snippets.

@rainrisa
Created September 10, 2023 22:04
Show Gist options
  • Save rainrisa/31349b4ee9c6d4233290f70d8e03ac89 to your computer and use it in GitHub Desktop.
Save rainrisa/31349b4ee9c6d4233290f70d8e03ac89 to your computer and use it in GitHub Desktop.

spesialis mongodb docker guide

  1. start mongodb server
sudo docker run --name mongodb-spesialis -p 27017:27017 -d mongo:4.4

if the message is something like this:

docker: Error response from daemon: Conflict. The container name "/mongodb-spesialis" is already in use by container "195f5c9430778c8a90e34c0398489863ff3d919741afe1fd1c007aee7c91abe0". You have to remove (or rename) that container to be able to reuse that name.

then we can just start the container

sudo docker container start mongodb-spesialis
  1. run mongodb client - start container
sudo docker run -d --name mongosh-spesialis mongo:4.4
  1. connect mongodb client
sudo docker exec -it mongosh-spesialis mongo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment