From 079f57941442130b1f47fbb30181390c8fdfd708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 21 Jan 2023 00:11:23 +0100 Subject: [PATCH] Specify WORKDIR /var/lib/haproxy (#203) * Specify WORKDIR /var/lib/haproxy Resolves docker-library/haproxy#200 * Explain WORKDIR reason --- 2.0/Dockerfile | 3 +++ 2.0/alpine/Dockerfile | 3 +++ 2.2/Dockerfile | 3 +++ 2.2/alpine/Dockerfile | 3 +++ 2.4/Dockerfile | 3 +++ 2.4/alpine/Dockerfile | 3 +++ 2.5/Dockerfile | 3 +++ 2.5/alpine/Dockerfile | 3 +++ 2.6/Dockerfile | 3 +++ 2.6/alpine/Dockerfile | 3 +++ 2.7/Dockerfile | 4 ++++ 2.7/alpine/Dockerfile | 4 ++++ 2.8/Dockerfile | 4 ++++ 2.8/alpine/Dockerfile | 4 ++++ Dockerfile.template | 8 ++++++++ 15 files changed, 54 insertions(+) diff --git a/2.0/Dockerfile b/2.0/Dockerfile index 7134b42..abbcae4 100644 --- a/2.0/Dockerfile +++ b/2.0/Dockerfile @@ -100,4 +100,7 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] # no USER for backwards compatibility (to try to avoid breaking existing users) + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.0/alpine/Dockerfile b/2.0/alpine/Dockerfile index e5d70f1..10b2745 100644 --- a/2.0/alpine/Dockerfile +++ b/2.0/alpine/Dockerfile @@ -93,4 +93,7 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] # no USER for backwards compatibility (to try to avoid breaking existing users) + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.2/Dockerfile b/2.2/Dockerfile index 277fb74..ec75339 100644 --- a/2.2/Dockerfile +++ b/2.2/Dockerfile @@ -100,4 +100,7 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] # no USER for backwards compatibility (to try to avoid breaking existing users) + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.2/alpine/Dockerfile b/2.2/alpine/Dockerfile index 410220a..3ea83eb 100644 --- a/2.2/alpine/Dockerfile +++ b/2.2/alpine/Dockerfile @@ -93,4 +93,7 @@ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] # no USER for backwards compatibility (to try to avoid breaking existing users) + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.4/Dockerfile b/2.4/Dockerfile index 6d6e3b1..916f4f9 100644 --- a/2.4/Dockerfile +++ b/2.4/Dockerfile @@ -96,4 +96,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.4/alpine/Dockerfile b/2.4/alpine/Dockerfile index c943595..42eac76 100644 --- a/2.4/alpine/Dockerfile +++ b/2.4/alpine/Dockerfile @@ -89,4 +89,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.5/Dockerfile b/2.5/Dockerfile index a0f92f2..1c0d037 100644 --- a/2.5/Dockerfile +++ b/2.5/Dockerfile @@ -96,4 +96,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.5/alpine/Dockerfile b/2.5/alpine/Dockerfile index 0bdd4ea..7a01f01 100644 --- a/2.5/alpine/Dockerfile +++ b/2.5/alpine/Dockerfile @@ -89,4 +89,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.6/Dockerfile b/2.6/Dockerfile index e933e2a..cfcbf5b 100644 --- a/2.6/Dockerfile +++ b/2.6/Dockerfile @@ -96,4 +96,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.6/alpine/Dockerfile b/2.6/alpine/Dockerfile index c9f26d1..f649513 100644 --- a/2.6/alpine/Dockerfile +++ b/2.6/alpine/Dockerfile @@ -89,4 +89,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.7/Dockerfile b/2.7/Dockerfile index db64196..22bf252 100644 --- a/2.7/Dockerfile +++ b/2.7/Dockerfile @@ -96,4 +96,8 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# https://github.com/docker-library/haproxy/issues/200 +WORKDIR /var/lib/haproxy + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.7/alpine/Dockerfile b/2.7/alpine/Dockerfile index b826a3d..c149bba 100644 --- a/2.7/alpine/Dockerfile +++ b/2.7/alpine/Dockerfile @@ -89,4 +89,8 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# https://github.com/docker-library/haproxy/issues/200 +WORKDIR /var/lib/haproxy + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.8/Dockerfile b/2.8/Dockerfile index 2b91da9..033cc0c 100644 --- a/2.8/Dockerfile +++ b/2.8/Dockerfile @@ -96,4 +96,8 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# https://github.com/docker-library/haproxy/issues/200 +WORKDIR /var/lib/haproxy + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/2.8/alpine/Dockerfile b/2.8/alpine/Dockerfile index 30954a1..59bd10b 100644 --- a/2.8/alpine/Dockerfile +++ b/2.8/alpine/Dockerfile @@ -89,4 +89,8 @@ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] USER haproxy + +# https://github.com/docker-library/haproxy/issues/200 +WORKDIR /var/lib/haproxy + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/Dockerfile.template b/Dockerfile.template index 4632428..4a40839 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -170,4 +170,12 @@ ENTRYPOINT ["docker-entrypoint.sh"] {{ ) else ( -}} USER haproxy {{ ) end -}} + +{{ if [ "2.0", "2.2", "2.4", "2.5", "2.6" ] | index(env.version) then ( -}} +# no WORKDIR for backwards compatibility (to try to avoid breaking existing users) +{{ ) else ( -}} +# https://github.com/docker-library/haproxy/issues/200 +WORKDIR /var/lib/haproxy +{{ ) end -}} + CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]