I worked on this problem all day and came to the conclusion that at present it is simply impossible to run postgresql inside the docker container, keeping your data constant in a separate volume.
I even tried to start the container without being bound to that and copy the data that was originally in / var / lib / postgresql to the folder of my operating system (Windows 10 Home), and then copy it to the folder associated with the container itself.
Alas, I got the following error:
FATAL: data directory "/var/lib/postgresql/data/pgadmin" has wrong ownership HINT: The server must be started by the user that owns the data directory.
In conclusion: There is something wrong with the ownership and the correct user who owns it, and in order to be able to fix it, you will need a unix command line on Windows that can run dockers (something is currently not possible using Bash on Ubuntu on Windows, which works using Ubuntu binary 16.04).
You may be able to run the necessary commands in the future (here, under Arbitrary --user Notes ), but these * nix commands and powershell (launched by Kitematic) cannot run them. Bash for Ubuntu for Windows can run them, but this shell has no connection to the docker / service daemon on windows ...
TL DR: Lost day of work: on Windows, this is not possible.
source share