docker-library / docker-library/postgres

Should failing entrypoint scripts clean up data directory?

Open
#159 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
Shell
Stars
2.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

For instance, I have some scripts that set up some users and such using ENV variables passed to docker run. I want to make sure that if those variables were not passed to the docker run then the initialization process halts. Currently, the data directory is created and can be left in some undetermined state if one of the entrypoint scripts fails.

Should it perhaps create the data directory in a temporary location first, and when all scripts complete successfully - move it to the $PG_DATA location and clean everything up if those scripts fail?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the entrypoint scripts invoked by docker run and reproduce initialization with the required environment variables omitted. Determine how failures leave $PG_DATA and define a safe cleanup or commit point; done means failed initialization does not leave an undetermined data directory state.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgres, shell
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.