How do I do things like pg_dump and psql outside of the dockerized postgres server?
- Pull and run the latest postgres image
docker run --name postgresqldb -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=password -p 5432:5432 -d postgres
- Attempt to use psql
➜ git:(development) ✗ psql
zsh: command not found: psql
What I'm trying to do is start up a postgres server container and utilize that container to run database exports (pg_dump) directly out of my terminal, not through use of the container with docker exec
Though my terminal doesn't know what psql is. Is there a way I can hit this container through the port mappings? How would I do that?