Hi,
I changed a couple lines in the configuration file. After an unexpected PC reboot, the container won't start with exit code 1 and below logs:
2018-02-09 02:14:35.833 GMT [1] LOG: syntax error in file "/var/lib/postgresql/data/postgresql.conf" line 672, near token """
2018-02-09 02:14:35.833 GMT [1] FATAL: configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors
I tried to commit the container to a new image and run that image with bash entrypoint, to access the configuration file. However the data directory "/var/lib/postgresql/data" is empty...
Anyway that I can still access the container and recover the data?
Any input is appreciated.
This should get you access to the /var/lib/postgresql/data/ folder from your postgres container:
$ # could use almost any image here, like one with vim or emacs installed
$ docker run -it --rm --volumes-from postgres-container postgres bash
@yosifkit It works. Thank you very much.
Glad it worked for you! :+1:
Most helpful comment
This should get you access to the
/var/lib/postgresql/data/folder from your postgres container: