This repository was archived by the owner on Nov 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-22
lines changed Expand file tree Collapse file tree 2 files changed +15
-22
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,4 @@ ENV DOCKER_HOST unix:///tmp/docker.sock
3131VOLUME ["/etc/nginx/certs" ]
3232
3333ENTRYPOINT ["/app/docker-entrypoint.sh" ]
34- CMD ["nginx-proxy " ]
34+ CMD ["forego" , "start" , "-r " ]
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- check_unix_socket () {
5- if [[ $DOCKER_HOST == unix://* ]]; then
6- socket_file=${DOCKER_HOST# unix:// }
7- if ! [ -S $socket_file ]; then
8- cat >&2 << -EOT
9- ERROR: you need to share your docker host socket with a volume at $socket_file
10- Typically you should run your jwilder/nginx-proxy with: \` -v /var/run/docker.sock:$socket_file :ro\`
11- See documentation at http://git.io/vZaGJ
12- EOT
13- exit 1
14- fi
4+ # Warn if the DOCKER_HOST socket does not exist
5+ if [[ $DOCKER_HOST == unix://* ]]; then
6+ socket_file=${DOCKER_HOST# unix:// }
7+ if ! [ -S $socket_file ]; then
8+ cat >&2 << -EOT
9+ ERROR: you need to share your Docker host socket with a volume at $socket_file
10+ Typically you should run your jwilder/nginx-proxy with: \` -v /var/run/docker.sock:$socket_file :ro\`
11+ See the documentation at http://git.io/vZaGJ
12+ EOT
13+ socketMissing=1
1514 fi
16- }
17-
18- # ###############################################################################
15+ fi
1916
20- # check for the expected command
21- if [ " $1 " = ' nginx-proxy' ]; then
22- check_unix_socket
23- exec forego start -r
17+ # If the user has run the default command and the socket doesn't exist, fail
18+ if [ " $socketMissing " = 1 -a " $1 " = forego -a " $2 " = start -a " $3 " = ' -r' ]; then
19+ exit 1
2420fi
2521
26- # else default to run whatever the user wanted like "bash"
2722exec " $@ "
28-
29-
You can’t perform that action at this time.
0 commit comments