I'm working with docker-compose.
My docker-compose.yml looks like
redis:
image: redis
expose:
- "6379"
volumes:
- ./redis:/data
nerdzcrush:
image: nerdzeu/docker-nerdzcrush
ports:
- "8181:81"
links:
- redis
volumes:
- ./mediacrush:/home/mediacrush
When I run docker-compose up
everything works fine.
After that, I needed to change the mount path.
I stopped the containers with docker-compose stop
, I changed my docker-compose.yml in this way:
redis:
image: redis
expose:
- "6379"
volumes:
- ./nerdzcrush/redis:/data
nerdzcrush:
image: nerdzeu/docker-nerdzcrush
ports:
- "8181:81"
links:
- redis
volumes:
- ./nerdzcrush/mediacrush:/home/mediacrush
And I removed the old directories with
sudo rm -rf ./mediacrush ./redis
After that, I started the containers wiht docker-compose up -d
I expect that the containers start to work with the new path, but I see that the old path are used. Thus I have again ./mediacrush and ./redis in my folder.
That's something I understood wrongly about docker-compose or that's an issue with docker-compose?
I'm using docker-compose version: 1.5.0dev
Thank you
It's only supposed to preserve volumes if they are container data volumes (not host volumes like in your case).
I would try running docker-compose rm
to remove the containers (after stopping them). After that the up
should use the correct path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With