Better method for custom entrypoint / image tweaks? #7

Closed
opened 2020-09-08 17:48:39 +00:00 by 3wordchant · 1 comment
Owner

I found a way to define a custom entrypoint without having to make a new image but it feels like if I do it too many times it's going to open up a portal to hell:

  service:
    ..
    configs:
      - source: entrypoint_conf
        target: /docker-entrypoint.sh
        mode: 0555
    entrypoint: /docker-entrypoint.sh

configs:
  entrypoint_conf:
    name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
    file: entrypoint.sh.tmpl
    template_driver: golang

(Then entrypoint.sh.tmpl contains whatever custom commands you want, ending with a call to the parent image ENTRYPOINT or CMD - see the one in matrix-synapse for an example)

I found a way to define a custom entrypoint without having to make a new image but it feels like if I do it too many times it's going to open up a portal to hell: ``` service: .. configs: - source: entrypoint_conf target: /docker-entrypoint.sh mode: 0555 entrypoint: /docker-entrypoint.sh configs: entrypoint_conf: name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION} file: entrypoint.sh.tmpl template_driver: golang ``` (Then `entrypoint.sh.tmpl` contains whatever custom commands you want, ending with a call to the parent image `ENTRYPOINT` or `CMD` - see [the one in `matrix-synapse`](https://git.autonomic.zone/compose-stacks/matrix-synapse/src/branch/main/entrypoint.sh.tmpl) for an example)
Author
Owner

Closing for the moment until we start to actually see stuff breaking because of this, maybe it's fine :/

Closing for the moment until we start to actually see stuff breaking because of this, maybe it's fine :/
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#7
No description provided.