![]() #Docker mongodb compass installOptionally, if you want to build your own version of the image, and for example additionally install mongo-hacker shell enhancement, in your docker-compose.yml file you can replace image: mongo:latest with build. Pwd: $(_js_escape "$MONGO_INITDB_PASSWORD"), my only way to work with a mongo gui from wsl2(I use robo3t, but it should be the same), is to actually connect to a real online cluster with the connection string as you usually do. NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default. To do so, simply add the respective gateway IP in the MongoDB config file /etc/nf under bindIp in the network interface section. I executed following commands and found the IP address of my docker machine: docker-machine ls. even today, wsl2 localhost and windows localhost are not connected, and I couldn't find a simple way to connect. For connecting to your local MongoDB instance from a Container you must first allow to accept connections from the Docker bridge gateway. User: $(_js_escape "$MONGO_INITDB_USERNAME"), the problem is not the mongo compass, but the localhost. docker/mongodb/initdb.d/create-app-user.sh #!/bin/bash ![]() I fwe want to use it, we need to start mongod with the -f parameter. The default mongo image command to start mongod service is just mongod, which does not use the /etc/nf configuration file. Override the default command to start the service in the container. Pull/Restart the docker container mongodb Enter the bash shell docker exec -it mongodb bash Now open the mongodb compass community and with same default. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |