entrypoint.sh 418 B

123456789101112131415161718
  1. #!/bin/sh
  2. set -e
  3. # first arg is `-f` or `--some-option`
  4. if [ "${1#-}" != "$1" ]; then
  5. set -- traefik "$@"
  6. fi
  7. # if our command is a valid Traefik subcommand, let's invoke it through Traefik instead
  8. # (this allows for "docker run traefik version", etc)
  9. if traefik "$1" --help >/dev/null 2>&1
  10. then
  11. set -- traefik "$@"
  12. else
  13. echo "= '$1' is not a Traefik command: assuming shell execution." 1>&2
  14. fi
  15. exec "$@"