I am using the following standard to mount a local volume into my postgres container as described here: https://hub.docker.com/_/postgres
$ docker run -d
--name some-postgres
-e POSTGRES_PASSWORD=mysecretpassword
-e PGDATA=/var/lib/postgresql/data/pgdata
-v /custom/mount:/var/lib/postgresql/data
postgres
It worked well for months but since the last docker update to Docker version 27.3.1, build ce1223035a it does not work anymore. I’m using colima on my Mac with the docker engine.
When I run the same command now I get the following error message:
chown: changing ownership of ‘/var/lib/postgresql/data/pgdata’: Permission denied
Why the heck did it work before and now causes issues? As far as I understand the documentation as longs as you keep the standard as mentioned here –> https://github.com/docker-library/postgres/issues/361#issuecomment-490241136
everything should be alright.
Any ideas?
2
Answers
@Yusuf thank you very much that you posted the solution here on stackoverflow as well! I would like to thank you here as well for posting the solution. Changing the vm-type in colima to
vz
did the trick.Thank you very much!
I’ve first seen your comment at docker-library/postgres#361. After further research, I’ve found a solution in Colima repo, here.
Here is the solution:
You can also enable Rosetta 2 emulation for better performance in amd64 emulation:
Alternatively, you can use
colima template
with the following options to set the default options, to avoid having to pass them tocolima start
: