{"action":"opened","issue":{"url":"https://api.github.com/repos/docker-library/postgres/issues/94","labels_url":"https://api.github.com/repos/docker-library/postgres/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/postgres/issues/94/comments","events_url":"https://api.github.com/repos/docker-library/postgres/issues/94/events","html_url":"https://github.com/docker-library/postgres/issues/94","id":108897417,"number":94,"title":"Problem with postgres data volume ","user":{"login":"vallettea","id":371303,"avatar_url":"https://avatars.githubusercontent.com/u/371303?v=3","gravatar_id":"","url":"https://api.github.com/users/vallettea","html_url":"https://github.com/vallettea","followers_url":"https://api.github.com/users/vallettea/followers","following_url":"https://api.github.com/users/vallettea/following{/other_user}","gists_url":"https://api.github.com/users/vallettea/gists{/gist_id}","starred_url":"https://api.github.com/users/vallettea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vallettea/subscriptions","organizations_url":"https://api.github.com/users/vallettea/orgs","repos_url":"https://api.github.com/users/vallettea/repos","events_url":"https://api.github.com/users/vallettea/events{/privacy}","received_events_url":"https://api.github.com/users/vallettea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-29T15:42:30Z","updated_at":"2015-09-29T15:42:30Z","closed_at":null,"body":"Hello\r\n\r\nI'm using postgres 9.4 image and I wish to have my data persisted under `/data/2life/db`. In compose, I have such a definition where i bind `/data/2life/db` to `/var/lib/postgresql`\r\n\r\n```\r\ndb:\r\n   image: postgres:9.4\r\n   environment:\r\n      - POSTGRES_USER=rr\r\n      - PGPASSWORD=rr \r\n      - POSTGRES_PASSWORD=rr\r\n   volumes:\r\n      - /data/2life/db:/var/lib/postgresql\r\n```\r\n\r\nhowever when I inspect my container I notice that the data is persisted in an other volume `/var/lib/docker/volumes...` which i didn't asked.\r\n\r\n```\r\n    \"Volumes\": {\r\n        \"/var/lib/postgresql\": \"/data/2life/db\",\r\n        \"/var/lib/postgresql/data\": \"/var/lib/docker/volumes/c90e06963f716494b5d3a3c24a61796dcaee983697ad65c3d76fe069f45d17b1/_data\"\r\n    },\r\n```\r\n\r\ndoes someone has an explanation or another way to persist data where we want ?\r\nthx"}}