I'm trying to run the container of postgres
image with boot2docker
on OSX.
This command works well on my Ubuntu:
docker run -v $(pwd)/data:/var/lib/postgresql/data postgres
but OSX says:
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"
chmod
doesn't help.
I've tried option --user $(id -u):$(id -g)
. It breaks container on Ubuntu, and it changes the error on OSX.
Ubuntu: chmod: changing ownership of ‘/var/lib/postgresql/data’: Operation not permitted
OSX: chmod: changing permissions of ‘/run/postgresql’: Operation not permitted
As it works for Ubuntu I want to run it on OSX, without creating my own images. But I have no idea how to deal with this error.
Any ideas?