Thursday, April 12, 2018

Getting Started with Postgres Docker image

This command will download and run docker container
 sudo docker run --name dipen-postgres -p 5432:5432  -e POSTGRES_PASSWORD=<your-password> -d postgres  

Note: username = postgres


To run the image and expose the port 5442 of docker image to host port
 sudo docker run -p 5432:5432 postgres   

If you need to download postgresql client
 sudo apt-get install postgresql-client  

To connect the postgres data hosted in docker container with psql client
 psql -h localhost -p 5432 -U postgres  

https://docs.docker.com/samples/library/postgres/

https://zaiste.net/posts/docker_postgresql_how_to/


https://hub.docker.com/_/postgres/

https://docs.docker.com/engine/examples/postgresql_service/#connecting-from-your-host-system

Run Program in background Linux

To run the process in background use & at the end of bash command
 ./idea.sh &  

To view the jobs running in background
 jobs  
Useful links

SQL INTERVIEW QUESTIONS AND ANSWERS