diff --git a/Dockerfile.template b/Dockerfile.template index 9715ae9..05d1f8a 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -59,7 +59,7 @@ ENV HAPROXY_SHA256 {{ .sha256 }} # Since 5.4 is supported on haproxy, better use it now, but only for # newer versions since there could be some minor incompatibilities # for existing scripts: https://www.lua.org/manual/5.4/manual.html#8 - if ([ "2.2", "2.4", "2.6", "2.8" ] | index(env.version)) then + if env.version | IN("2.2", "2.4", "2.6", "2.8") then "5.3" else "5.4" @@ -81,7 +81,7 @@ RUN set -eux; \ pcre2-dev \ readline-dev \ tar \ -{{ if ([ "2.2" ] | index(env.version)) then ( -}} +{{ if env.version == "2.2" then ( -}} zlib-dev \ {{ ) else "" end -}} ; \ @@ -95,7 +95,7 @@ RUN set -eux; \ libssl-dev \ make \ wget \ -{{ if ([ "2.2" ] | index(env.version)) then ( -}} +{{ if env.version == "2.2" then ( -}} zlib1g-dev \ {{ ) else "" end -}} ; \ @@ -122,15 +122,15 @@ RUN set -eux; \ USE_LUA=1 LUA_INC=/usr/include/lua{{ lua }}{{ if env.variant == "alpine" then (" LUA_LIB=/usr/lib/lua" + lua) else "" end }} \ USE_OPENSSL=1 \ USE_PCRE2=1 USE_PCRE2_JIT=1 \ -{{ if ([ "2.2" ] | index(env.version)) then ( -}} +{{ if env.version == "2.2" then ( -}} USE_ZLIB=1 \ {{ ) else "" end -}} -{{ if ([ "2.2" ] | index(env.version) | not) then ( -}} +{{ if env.version == "2.2" then "" else ( -}} USE_PROMEX=1 \ -{{ ) else "" end -}} +{{ ) end -}} \ EXTRA_OBJS=" \ -{{ if [ "2.2" ] | index(env.version) then ( -}} +{{ if env.version == "2.2" then ( -}} # see https://github.com/docker-library/haproxy/issues/94#issuecomment-505673353 for more details about prometheus support contrib/prometheus-exporter/service-prometheus.o \ {{ ) else "" end -}} @@ -188,12 +188,12 @@ RUN set -eux; \ STOPSIGNAL SIGUSR1 COPY docker-entrypoint.sh /usr/local/bin/ -{{ if [ "2.2" ] | index(env.version) then ( -}} +{{ if env.version == "2.2" then ( -}} RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat {{ ) else "" end -}} ENTRYPOINT ["docker-entrypoint.sh"] -{{ if [ "2.2" ] | index(env.version) then ( -}} +{{ if env.version == "2.2" then ( -}} # no USER for backwards compatibility (to try to avoid breaking existing users) {{ ) else ( -}} USER haproxy diff --git a/versions.sh b/versions.sh index 564cb09..205de75 100755 --- a/versions.sh +++ b/versions.sh @@ -37,7 +37,7 @@ for version in "${versions[@]}"; do alpine: env.alpine, } # remove Alpine from versions where it cannot be built on any active Alpine release - | if [ "2.2" ] | index(env.version) then del(.alpine) else . end + | if env.version == "2.2" then del(.alpine) else . end ' )"