Skip to content

Allow overriding entrypoint for pre_start init containers #14162

Description

@phr34k

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions