Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Alpine image: allows CMD override to shell when a non Traefik command is provided #51

Merged
merged 1 commit into from Jun 19, 2019
Merged

Alpine image: allows CMD override to shell when a non Traefik command is provided #51

merged 1 commit into from Jun 19, 2019

Conversation

dduportal
Copy link
Contributor

Related to docker-library/official-images#6106 (comment)

TL;DR; the "official Docker image test suite" run by Docker requires the CMD to be overridden when an image has a shell (as the Alpine Traefik).
With v2.0-alpha6, the Traefik CLI accepts non flags options, which leads to issues.

This change is only alpine, and delegate to the main shell the user-provided CMD if it is not a command recognized by traefik.

So the following exemple works:

# print Traefik version
docker run --rm traefik:<tag> version
# print Traefik help about healthcheck Traefik's command
docker run --rm traefik:<tag> healthcheck --version
# print "Hello world-<random number>-<random number>" with a message in the log that switched to shell
docker run --rm traefik:<tag> echo Hello world-$RANDOM-$RANDOM

Important: works with 1.7.12, but for 2.0, it requires traefik/traefik#4977 to be merged!

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit f33a896 into containous:master Jun 19, 2019
@dduportal dduportal deleted the fix/entrypoint branch June 19, 2019 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants