docker / docker/compose

Allow overriding entrypoint for pre_start init containers

Open
#14,162 1 comment 0 reactions 1 assignee View on GitHub

@ndeloof is already working on this.

Since Sep 2, 2026.

kind/feature
Dominant language
Go
Stars
38.2k
Forks
5.8k
Avg merge
2d 14h
Merged PRs (30d)
55

Description

Description

pre_start init containers are useful for preparing files or other resources before a service starts, but currently there is no way to override the image's ENTRYPOINT for an individual init container. This becomes problematic when using purpose-built utility images whose functionality is exposed through their default entrypoint.

For example, I have some services that require TLS and does not support a non-TLS bootstrap mode. An init container could generate a self-signed certificate before the service starts. A natural choice would be to use an OpenSSL image. However, if alpine/openssl has an entrypoint that is not appropriate for the desired initialization command, there is no way to replace it.

The workaround is to use a generic Alpine image and install OpenSSL at runtime, but when using services that require self signed certificates multiple "apk add --no-cache openssl" compounds and slow down initialization.

services:
  app:
    image: example/app

    pre_start:
      - command:
          - sh
          - -c
          - |
            apk add --no-cache openssl
            openssl req -x509 ...

Please consider to allow entrypoint to be specified for pre_start init containers, overriding the image's default ENTRYPOINT in the same way that entrypoint can be overridden for regular Compose services. This would allow init containers to use existing utility images without having to create wrapper images or install their tooling at runtime.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.