Skip to content

"/var/lib/postgresql/data/global" Under boot2docker on Yosemite #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fredjean opened this issue Oct 23, 2014 · 3 comments
Closed

"/var/lib/postgresql/data/global" Under boot2docker on Yosemite #28

fredjean opened this issue Oct 23, 2014 · 3 comments

Comments

@fredjean
Copy link

I am trying to run this box on a Mac OS 10.10 system with boot2docker and Docker 1.3 running. Here is the output that I get:

$  fig run db
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... initdb: could not create directory "/var/lib/postgresql/data/global": Permission denied
initdb: removing contents of data directory "/var/lib/postgresql/data"

I am having it use an external volume so that the database can persist between each run. This is done through fig:

db:
  image: postgres:9.3
  ports:
    - "5432"
  volumes:
    - "../pg_data:/var/lib/postgresql/data"

I suspect that this is related to #26 . I tried clearing ~/.boot2docker and removing the VM without success.

Let me know if there is something else you need.

@fredjean
Copy link
Author

More than likely caused by boot2docker/boot2docker#581

@vmaatta
Copy link

vmaatta commented Oct 24, 2014

Yes, this is caused by the fact that the VirtualBox shared folder is not writable by the 999:999 container user. You'd get over that by using a custom vmboxsf and UID:GID of 999:50. But then you'd hit another problem, initdb will try to create hard links and those will not work with VirtualBox shared folders. I'm not sure whether you could bind mount the data if it's already mostly created. For now I'll just let the data be inside the container and think about moving it out later if I need to.

@fredjean
Copy link
Author

I'll close the issue then since there isn't much that can be done at this layer.

Thank you for confirming the root cause!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants