I'm having a tough time getting my PostgreSQL container to run. I'm encountering this error: "Error response from daemon: failed to create task for container... no such file or directory: unknown." I've set up my Docker configuration like this:
```
db:
image: postgres:latest
container_name: flatmate.db
environment:
POSTGRES_DB: flatmate
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./.containers/flatmate-db:/var/lib/postgresql/data
ports:
- "5432:5432"
```
Can someone help me understand what's going wrong?
1 Answer
It looks like you're using the `latest` tag for PostgreSQL, which can be risky! You might have accidentally updated to PostgreSQL 18, which changed the default data volume directory. Try switching your image to a specific version instead, like PostgreSQL 15, and it should solve your issue. Many people run into complications with the `latest` tag, so it's a good practice to avoid it. Let me know if you need more help!

Just changed the version to 15 and it’s fixed. Really appreciate it!