i try to understand why, by executing this command :
docker run --rm -it postgres bash
container starts well, gives me a bash prompt, without intializing a postgres server.
In fact, when i only execute this :
docker run --rm -it postgres
container tries to intialize a postgres server and failed because a non provided '-e POSTGRES_PASSWORD' sequence which is absolutly normal.
But the question is : what is the mechanism in 'docker' or 'in the official postgres image' that tell container to :
- not initialize a postgres server when an argument is provided at the end of 'docker run --rm -it postgres' sequence (like bash or psql..)
- DO initialize a postgres server when NO argument is provided (docker run --rm -it postgres)
Thanks by advance.