I would like to delete my postgres volume and start over (learning the process). When I enter the postgres container using docker exec -it [container_id] sh I can see the postgres files like this: ls var/lib/postgresql/data/.
When I try to delete these files using rm -r var/lib/postgresql/ I get:
rm: can't remove 'var/lib/postgresql/data': Resource busy
If I stop this container, I will not be able to delete the volume. How can I delete it?
Fwiw my docker-compose looks as such:
services:
db:
container_name: postgres
image: postgres:13-alpine
volumes:
- ./postgres:/var/lib/postgresql/data
env_file:
- .env
Edit:
The docker-compose is pulled from my GitHub. I am not sure where any of the files are on the server. NVM, found them. Thanks.
./postgres. You can delete that folder. Or you can remove the volume withdocker volume rm volume_name