I need help to write Dockerfile to create TimescaleDB in a container. I found this instruction for creating a container:
docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg12
But I want to be able to specify the login and data base name and run creation with pipeline.
Thanks.
I guess you use a docker image from timescale/timescaledb. The Dockerfile used to build these images is public in GH repo timescale/timescaledb-docker. TimescaleDB docker image is based from postgres-alpine and thus inherits entrypoint from there. The description of postgres image presents available environment variables, which can be used during new container start. It includes POSTGRES_DB, which can be used to specify the database to create on start.
If the available options is not enough, the entrypoint can be redefined by using option --entrypoint for docker run command.
Summary:
docker run --entrypoint, see the doc.Note that Timescale also provides docker image of TimescaleDB with HA for k8s. This one doesn't inherit from postgres and contains own entrypoint.