-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image
Description
I have problems to create a custom DB in docker-compose using the environment variables and postgres docker image.
having this docker.compose.yml
file and running docker-compose up -d
postgres:
restart: 'true'
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_DB:test_db
the container created does not contain the test_db
database
But if I run the following command:
docker run -e POSTGRES_DB=test_db --name postgres-test -d -p 5432:5432 postgres
the created container DO have the test_db
I was reading the following links and everything looks good.
https://hub.docker.com/_/postgres/
https://docs.docker.com/engine/reference/run/#/env-environment-variables
https://docs.docker.com/compose/environment-variables/
Sure I am missing something because it should be straightforward. But what?
thank for your time and help!
Mastergalen, raj-optisol, ligue, felixtan, Mikulas and 47 morejeckep
Metadata
Metadata
Assignees
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image