Add "reload" support to Alpine by converting the docker-entrypoint.sh to POSIX

This commit is contained in:
Tianon Gravi committed 2016-03-16 10:28:28 -07:00
1 parent fa117ac983
commit a11db1597f
9 files changed
+54 -9

No files matched your search

+2
View File
@@ -41,4 +41,6 @@ RUN set -x \
&& apk add --virtual .haproxy-rundeps $runDeps \
&& apk del .build-deps
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi
exec "$@"
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash
set -eo pipefail
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1:0:1}" = '-' ]; then
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi
+2
View File
@@ -41,4 +41,6 @@ RUN set -x \
&& apk add --virtual .haproxy-rundeps $runDeps \
&& apk del .build-deps
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi
if [ "$1" = 'haproxy' ]; then
# if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream
shift # "haproxy"
set -- "$(which haproxy-systemd-wrapper)" -p /run/haproxy.pid "$@"
fi
exec "$@"
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash
set -eo pipefail
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1:0:1}" = '-' ]; then
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi
+2
View File
@@ -41,4 +41,6 @@ RUN set -x \
&& apk add --virtual .haproxy-rundeps $runDeps \
&& apk del .build-deps
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi
if [ "$1" = 'haproxy' ]; then
# if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream
shift # "haproxy"
set -- "$(which haproxy-systemd-wrapper)" -p /run/haproxy.pid "$@"
fi
exec "$@"
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash
set -eo pipefail
#!/bin/sh
set -e
# first arg is `-f` or `--some-option`
if [ "${1:0:1}" = '-' ]; then
if [ "${1#-}" != "$1" ]; then
set -- haproxy "$@"
fi