You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The README.md has some hints on how to use the image, but as someone very new to Docker I found it very hard to follow.
After a lot of wrangling I finally figured out how to get things working. Here are some changes I suggest adding to the README.md. I don't know how to make changes to it so I thought I'd leave suggestions here so someone more knowledgeable can do it (or tell me how!).
The main thing I struggled with was trying to start a demo postgres process and connect to it with psql. After struggling a lot I realized that you have to have TWO containers running - one with the postgres process, and a second one running psql.
Directly under "How to use this image," add some text along the lines of "There are three main ways to use this image: to run postgres, run psql to interact with a postgres process already running on another host, or to include a database with other processes in a container using docker compose." Seems obvious in hindsight, but I thought that the docker run ... command given for psql use case would both start a postgres database AND start psql. But that's not what happens. Took a long time to figure that out.
Change "start a postgres instance" to "1. Start a postgres instance". The "1." will help make it clear that it's the first
Change "... or via psql" to "2. Or run psql". The "via" is misleading because it implies the docker run ... command will start postgres via some machinery in the image that will also run psql. But that's not what happens (I think) - if you use the supplied shell command with docker run ..., the docker-entrypoint.sh script will only run psql. It won't also start a postgres database. So the "via" should be removed.
Under the heading for (3) (currently "... or via psql"), add something like "Instead of starting a postgres database, you can use this image to run psql. You can create a test database to interact with the instructions above." This way it's clear that it's an either-or proposition. There's no docker run ... command that will do both.
In the docker run ... commands, replace postgres (the image name) with <image_name> or similar. This makes it clear which argument is the name of the image, versus the default postgres user name, versus the name of the container. It would also be really helpful to explain the image name, such as "image_name can be postgres to automatically use the latest version of postgres, or e.g. postgres:15-alpine to use a specific version."
The text was updated successfully, but these errors were encountered:
The README.md has some hints on how to use the image, but as someone very new to Docker I found it very hard to follow.
After a lot of wrangling I finally figured out how to get things working. Here are some changes I suggest adding to the README.md. I don't know how to make changes to it so I thought I'd leave suggestions here so someone more knowledgeable can do it (or tell me how!).
The main thing I struggled with was trying to start a demo postgres process and connect to it with psql. After struggling a lot I realized that you have to have TWO containers running - one with the postgres process, and a second one running psql.
docker run ...
command given forpsql
use case would both start a postgres database AND start psql. But that's not what happens. Took a long time to figure that out.docker run ...
command will start postgres via some machinery in the image that will also run psql. But that's not what happens (I think) - if you use the supplied shell command withdocker run ...
, the docker-entrypoint.sh script will only runpsql
. It won't also start a postgres database. So the "via" should be removed.psql
. You can create a test database to interact with the instructions above." This way it's clear that it's an either-or proposition. There's nodocker run ...
command that will do both.docker run ...
commands, replacepostgres
(the image name) with<image_name>
or similar. This makes it clear which argument is the name of the image, versus the default postgres user name, versus the name of the container. It would also be really helpful to explain the image name, such as "image_name
can bepostgres
to automatically use the latest version of postgres, or e.g.postgres:15-alpine
to use a specific version."The text was updated successfully, but these errors were encountered: