node-express: container_name: node-express-dev build: context: ./ dockerfile: Dockerfile.dev ports: - "5000:5000" volumes: - .:/src/app depends_on: - mongodb-node-dev restart: always mongodb-node-dev: container_name: mongodb-node-dev image: mongo:4.2.6 restart: always ports: - "27018:27017" volumes: - mongodbdata:/data/db volumes: mongodbdata:
I have the above ‘volumes’ named, but I’m still getting new volumes added to my
volumes list when I use
docker volume ls. I don’t understand why I’m getting this kind of ghosting.
When I run
docker volume ls I get this:
DRIVER VOLUME NAME local a696c50e761d87af6b1e108d7fb56d98faa1675195cc7b29dd6a5d319ec89f42 local mongodbdata
I’m baffled that I have more than 1. If I run
docker-compose up that I get two volumes, the one I created; fine, but then this other one. If I run
docker-compose down and then
up again I’ll get another volume added for 3 in total. It keeps adding another one.
One thing I’m coming around to understanding is that I should only use
docker-compose up once and the rest of the time it should be
docker-compose start or
down I guess is for when the project is likely over…I think. Still learning, but regardless of that part I’m still baffled by the two volumes, versus just the 1.
Feel free to expand or really anything on any assistance since I’m very new I’m working hard to learn as much as I can. No knowledge shared is wasted here.
Please and thank you!