docker run -v postgres:/var/lib/postgresql/data --name postgres-test -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Connect with a one-off docker container in current process:
docker run -v pgadmin4:/home/pgadmin/.pgadmin -p 5050:5050 --link postgres-test:postgres-test --rm meedan/pgadmin
Connect with a persistant docker container as background process:
docker run -v pgadmin4:/home/pgadmin/.pgadmin -p 5050:5050 --link postgres-test:postgres-test --name pgadmin -d meedan/pgadmin
You can stop with docker stop pgadmin
and restart with docker start pgadmin
. Just make sure the postgres container is running as well.
Open http://localhost:5050.
Add server, and use postgres
as hostname, postgres
as user, and mysecretpassword
as password.
When connecting to the DB I believe the hostname should be postgres-test (not postgres). Otherwise, this worked great. Thanks.