title: How does official Postgres image create user and database with env variables?
body: <p>Official Postgres images for Docker uses two environment variables:
  POSTGRES_USER and POSTGRES_PASSWORD to parametrize database creation:</p>
  
  <p><a href="https://registry.hub.docker.com/_/postgres/" rel="nofollow">https://registry.hub.docker.com/_/postgres/</a></p>
  
  <p>I expected that the environment variables will be used in the image source:</p>
  
  <p><a href="https://github.com/docker-library/postgres/blob/bfca9b8a92a99ccfc8f04933b7ecc29a108c7f49/9.4/Dockerfile" rel="nofollow">https://github.com/docker-library/postgres/blob/bfca9b8a92a99ccfc8f04933b7ecc29a108c7f49/9.4/Dockerfile</a></p>
  
  <p>but there's not trace of them there.</p>
  
  <p>Could you explain how it is made that a user specified with the environment variables is created with a container?</p>