Hello people, I’m kinda new in docker so I beg your indulgence in case my question is obvious.
I created two containers, the first based on plain ubuntu image and the second in plain mongodb image (both the oficial version)
These are de commands I use to launch the containers
docker run -it --entrypoint /bin/bash --hostname MONGODB --name=MONGODB --net=bridge --expose=27017 mongo
docker run -it -p 8080:8080 --entrypoint /bin/bash --hostname APP1 --name=APP1 --link=MONGODB --net=bridge ubuntu
The thing is I can ping the mongodb container from the APP container, but cannot access the mongodb either from an app in Node nor from the mongdb command-line client.
I’d very much appreciate any hint you could give me since I’ve already tryed a lot of things (I’d rather avoid using docker-compose )
The idea is to connect both containers directly whitout exporting the mongodb port to the host ( I mean, I dont want to use the -p parameter for the mongodb container)
Thanks in advance