diff --git a/1.4/alpine/Dockerfile b/1.4/alpine/Dockerfile index 6d53d32..7ebe30d 100644 --- a/1.4/alpine/Dockerfile +++ b/1.4/alpine/Dockerfile @@ -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"] diff --git a/1.4/alpine/docker-entrypoint.sh b/1.4/alpine/docker-entrypoint.sh new file mode 100755 index 0000000..06c4dfa --- /dev/null +++ b/1.4/alpine/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +exec "$@" diff --git a/1.4/docker-entrypoint.sh b/1.4/docker-entrypoint.sh index cb8b89c..06c4dfa 100755 --- a/1.4/docker-entrypoint.sh +++ b/1.4/docker-entrypoint.sh @@ -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 diff --git a/1.5/alpine/Dockerfile b/1.5/alpine/Dockerfile index 86ebc4b..5c047ed 100644 --- a/1.5/alpine/Dockerfile +++ b/1.5/alpine/Dockerfile @@ -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"] diff --git a/1.5/alpine/docker-entrypoint.sh b/1.5/alpine/docker-entrypoint.sh new file mode 100755 index 0000000..1b413a9 --- /dev/null +++ b/1.5/alpine/docker-entrypoint.sh @@ -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 "$@" diff --git a/1.5/docker-entrypoint.sh b/1.5/docker-entrypoint.sh index e242db2..1b413a9 100755 --- a/1.5/docker-entrypoint.sh +++ b/1.5/docker-entrypoint.sh @@ -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 diff --git a/1.6/alpine/Dockerfile b/1.6/alpine/Dockerfile index 2fcfcc4..00c4507 100644 --- a/1.6/alpine/Dockerfile +++ b/1.6/alpine/Dockerfile @@ -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"] diff --git a/1.6/alpine/docker-entrypoint.sh b/1.6/alpine/docker-entrypoint.sh new file mode 100755 index 0000000..1b413a9 --- /dev/null +++ b/1.6/alpine/docker-entrypoint.sh @@ -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 "$@" diff --git a/1.6/docker-entrypoint.sh b/1.6/docker-entrypoint.sh index e242db2..1b413a9 100755 --- a/1.6/docker-entrypoint.sh +++ b/1.6/docker-entrypoint.sh @@ -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