docker-library / docker-library/postgres

Initialization script when PGData is not empty

Open
#1,229 10 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I know that when the PGData directory is not empty the container skips the initialization and therefore won't run the initialization script in /docker-entrypoint-initdb.d

I would like to use a way to give the container scripts that will run on startup no matter what (for example to create a role postgres if one does not exist already)

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 reading how the container handles PGDATA and the /docker-entrypoint-initdb.d directory during startup. Define how scripts that run on every startup should differ from one-time initialization, including the requested case of creating a missing postgres role; done means the behavior is specified and covered for both empty and non-empty PGDATA.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgres, shell
Domain
databases, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.