Container breaks after adding local volume

I’m using a Postgres image from the hub and I manage to run it without a problem but as soon as a add a local volume connected to /var/lib/postgres/data (or something like that) the container fails to work. I think I’m doing something obvious wrong. Can anyone see what?
I want to have a local copy if database data so when docker exits I get to keep it.