2

Official Postgres images for Docker uses two environment variables: POSTGRES_USER and POSTGRES_PASSWORD to parametrize database creation:

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

I expected that the environment variables will be used in the image source:

https://github.com/docker-library/postgres/blob/bfca9b8a92a99ccfc8f04933b7ecc29a108c7f49/9.4/Dockerfile

but there's not trace of them there.

Could you explain how it is made that a user specified with the environment variables is created with a container?

2

1 Answer 1

3

The variables POSTGRES_USER and POSTGRES_PASSWORD are used in the entrypoint.sh file visible here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.