Running psql/postgres client in an ephemeral mode in a container
Currently your Dockerfile doesn't contain an execution script so it will finish &amp; exit...

If you want it to always run, you can 'tail -f some file '

But, you can skip it and combine the 2 commands to run the psql command &amp; exit:

docker run -it --link pg_server:pg_server_1 --name pg_client_1 psql -U my_user -h pg_server_1 -p 5432 -d my_db -c "select uncertainty_estimate(' land_cover', manifold_envelope(-81.85, 6.8, -81.01, 7.8, 4326))"


Docker treats the last arguments as a command to run directly.