Skip to content

Change to ENTRYPOINT + CMD & exec "${@}" mechanism #34

@niek-sidn

Description

@niek-sidn

Change to ENTRYPOINT + CMD & exec "${@}" mechanism in dockerfiles and entrypoints.

e.g.
Dockerfile:

COPY --chmod=755 entrypoints/entrypoint_bind.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/sbin/named","-c","/etc/bind/named.conf","-f","-g"]

Entrypoint:

#!/usr/bin/env bash
exec "${@}"

(Source: https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ & Phind.com):
Looks like this is the best way to prevent:

  • Data corruption during shutdown
  • Unnecessary delay in stopping containers
  • Incomplete cleanup operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions