docker-entrypoint.sh 639 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -e
  3. # Warn if the DOCKER_HOST socket does not exist
  4. if [[ $DOCKER_HOST == unix://* ]]; then
  5. socket_file=${DOCKER_HOST#unix://}
  6. if ! [ -S $socket_file ]; then
  7. cat >&2 <<-EOT
  8. ERROR: you need to share your Docker host socket with a volume at $socket_file
  9. Typically you should run your jwilder/nginx-proxy with: \`-v /var/run/docker.sock:$socket_file:ro\`
  10. See the documentation at http://git.io/vZaGJ
  11. EOT
  12. socketMissing=1
  13. fi
  14. fi
  15. # If the user has run the default command and the socket doesn't exist, fail
  16. if [ "$socketMissing" = 1 -a "$1" = forego -a "$2" = start -a "$3" = '-r' ]; then
  17. exit 1
  18. fi
  19. exec "$@"