Mongodb compass docker image6/13/2023 ![]() ![]() It offers all the features you need to handle. Which delivers improved usability and compatibility. MongoDB is one of the most widely-used open source NoSQL databases on the market. ![]() Warning: the "mongo" shell has been superseded by "mongosh", ➜ docker exec -it my-mongodb /bin/shĬonnecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Here we are also logging in to posgtres with the credentials we specified above and checking the version. Alternatively, set connection string MECONFIGMONGODBURL to the proper connection for your MongoDB container on your Docker network. We can login to the container using the docker exec command while executing /bin/bash interactively. Usage (Docker) Make sure you have a running MongoDB container on a Docker network (-network some-network below) with -name or -network-alias set to mongo. In my case the container is running as my- mongodb the name we gave it. To check that our container is running as expected, use the docker ps command:ĬONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESģ7c8bc5ba6ea mongo:5.0 "docker-entrypoint.s…" 4 hours ago Up 4 hours 0.0.0.0:27017->27017/tcp, :::27017->27017/tcp my-mongodb The supplied environment variables will be used to set up a Mongo DB root user and password. Congrats, you now have a running MongoDB on localhost:27017, now open your Mongo Compass app and use the following URL to connect: mongodb://root:MyPa. The -e argument is for the environment variables. Open Terminal, make sure you are still inside the mongodb folder and run: docker-compose build.The mongo:5.0 defines the image that we are running.That means the service can be accessed through localhost:6379 Container port 6379 is mapped to host port 6379. We are instructing the container to expose the container port externally. It run container in background and print container ID The -d instructs docker container to run as a detached process.The version of Mongodb that we want is mongo:5.0 the latest Mongodb version. We are going to use the docker run command to achieve our goal. Docker installed locally and permissions to use it to launch containers. ![]()
0 Comments
Leave a Reply. |