volumes

Docker-Compose mount volume overwrites host files

左心房为你撑大大i 提交于 2020-12-13 04:27:10
问题 I am mounting a directory from a CMS with content files inside a docker container. The mounting works absolutely. The CMS got some basic files, which are copied into the mounted folder in the container during build. Then it will be mounted to a directory on the host. Now the files from the Container are also on the host. I can change them and they will be kept in sync. If i restart my container docker-compose stop && docker-compose up -d the files on the host will be overwritten by the

Remove a named volume with docker-compose?

放肆的年华 提交于 2020-11-30 06:12:50
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible

Remove a named volume with docker-compose?

Deadly 提交于 2020-11-30 06:12:43
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible

Remove a named volume with docker-compose?

好久不见. 提交于 2020-11-30 06:12:40
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible