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.
@hakuno Thanks! I'll keep that in mind if I start using this again. If this is something you use regularly, please feel free to write a new gist or fork this one, and I'll update this one to link to it.
(Off-topic: Thank you Github for finally making gist comments notify me!)