From 79b36bf4e0ddf018ec8ab3626ca4ebf1fb8cac2d Mon Sep 17 00:00:00 2001 From: yzewei Date: Thu, 12 Dec 2024 09:06:30 +0800 Subject: [PATCH 01/13] haproxy 2.5-2.9 Signed-off-by: yzewei --- library/haproxy/2.5.0/Dockerfile | 87 ++++++ library/haproxy/2.5.0/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.0/Makefile | 21 ++ library/haproxy/2.5.0/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.1/Dockerfile | 87 ++++++ library/haproxy/2.5.1/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.1/Makefile | 21 ++ library/haproxy/2.5.1/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.10/Dockerfile | 87 ++++++ library/haproxy/2.5.10/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.10/Makefile | 21 ++ library/haproxy/2.5.10/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.11/Dockerfile | 87 ++++++ library/haproxy/2.5.11/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.11/Makefile | 21 ++ library/haproxy/2.5.11/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.12/Dockerfile | 87 ++++++ library/haproxy/2.5.12/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.12/Makefile | 21 ++ library/haproxy/2.5.12/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.13/Dockerfile | 87 ++++++ library/haproxy/2.5.13/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.13/Makefile | 21 ++ library/haproxy/2.5.13/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.14/Dockerfile | 87 ++++++ library/haproxy/2.5.14/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.14/Makefile | 21 ++ library/haproxy/2.5.14/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.2/Dockerfile | 87 ++++++ library/haproxy/2.5.2/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.2/Makefile | 21 ++ library/haproxy/2.5.2/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.3/Dockerfile | 87 ++++++ library/haproxy/2.5.3/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.3/Makefile | 21 ++ library/haproxy/2.5.3/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.4/Dockerfile | 87 ++++++ library/haproxy/2.5.4/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.4/Makefile | 21 ++ library/haproxy/2.5.4/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.5/Dockerfile | 87 ++++++ library/haproxy/2.5.5/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.5/Makefile | 21 ++ library/haproxy/2.5.5/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.6/Dockerfile | 87 ++++++ library/haproxy/2.5.6/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.6/Makefile | 21 ++ library/haproxy/2.5.6/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.7/Dockerfile | 87 ++++++ library/haproxy/2.5.7/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.7/Makefile | 21 ++ library/haproxy/2.5.7/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.8/Dockerfile | 87 ++++++ library/haproxy/2.5.8/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.8/Makefile | 21 ++ library/haproxy/2.5.8/docker-entrypoint.sh | 17 ++ library/haproxy/2.5.9/Dockerfile | 87 ++++++ library/haproxy/2.5.9/Dockerfile-alpine | 100 +++++++ library/haproxy/2.5.9/Makefile | 21 ++ library/haproxy/2.5.9/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.0/Dockerfile | 87 ++++++ library/haproxy/2.6.0/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.0/Makefile | 21 ++ library/haproxy/2.6.0/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.10/Dockerfile | 87 ++++++ library/haproxy/2.6.10/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.10/Makefile | 21 ++ library/haproxy/2.6.10/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.11/Dockerfile | 87 ++++++ library/haproxy/2.6.11/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.11/Makefile | 21 ++ library/haproxy/2.6.11/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.12/Dockerfile | 87 ++++++ library/haproxy/2.6.12/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.12/Makefile | 21 ++ library/haproxy/2.6.12/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.13/Dockerfile | 87 ++++++ library/haproxy/2.6.13/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.13/Makefile | 21 ++ library/haproxy/2.6.13/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.14/Dockerfile | 87 ++++++ library/haproxy/2.6.14/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.14/Makefile | 21 ++ library/haproxy/2.6.14/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.15/Dockerfile | 87 ++++++ library/haproxy/2.6.15/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.15/Makefile | 21 ++ library/haproxy/2.6.15/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.16/Dockerfile | 87 ++++++ library/haproxy/2.6.16/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.16/Makefile | 21 ++ library/haproxy/2.6.16/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.17/Dockerfile | 87 ++++++ library/haproxy/2.6.17/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.17/Makefile | 21 ++ library/haproxy/2.6.17/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.18/Dockerfile | 87 ++++++ library/haproxy/2.6.18/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.18/Makefile | 21 ++ library/haproxy/2.6.18/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.19/Dockerfile | 87 ++++++ library/haproxy/2.6.19/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.19/Makefile | 21 ++ library/haproxy/2.6.19/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.20/Dockerfile | 87 ++++++ library/haproxy/2.6.20/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.20/Makefile | 21 ++ library/haproxy/2.6.20/docker-entrypoint.sh | 17 ++ library/haproxy/2.6.3/Dockerfile | 87 ++++++ library/haproxy/2.6.3/Dockerfile-alpine | 100 +++++++ library/haproxy/2.6.3/Makefile | 21 ++ library/haproxy/2.6.3/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.0/Dockerfile | 87 ++++++ library/haproxy/2.7.0/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.0/Makefile | 21 ++ library/haproxy/2.7.0/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.1/Dockerfile | 87 ++++++ library/haproxy/2.7.1/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.1/Makefile | 21 ++ library/haproxy/2.7.1/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.10/Dockerfile | 87 ++++++ library/haproxy/2.7.10/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.10/Makefile | 21 ++ library/haproxy/2.7.10/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.11/Dockerfile | 87 ++++++ library/haproxy/2.7.11/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.11/Makefile | 21 ++ library/haproxy/2.7.11/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.12/Dockerfile | 87 ++++++ library/haproxy/2.7.12/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.12/Makefile | 21 ++ library/haproxy/2.7.12/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.2/Dockerfile | 87 ++++++ library/haproxy/2.7.2/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.2/Makefile | 21 ++ library/haproxy/2.7.2/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.3/Dockerfile | 87 ++++++ library/haproxy/2.7.3/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.3/Makefile | 21 ++ library/haproxy/2.7.3/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.4/Dockerfile | 87 ++++++ library/haproxy/2.7.4/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.4/Makefile | 21 ++ library/haproxy/2.7.4/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.5/Dockerfile | 87 ++++++ library/haproxy/2.7.5/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.5/Makefile | 21 ++ library/haproxy/2.7.5/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.6/Dockerfile | 87 ++++++ library/haproxy/2.7.6/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.6/Makefile | 21 ++ library/haproxy/2.7.6/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.7/Dockerfile | 87 ++++++ library/haproxy/2.7.7/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.7/Makefile | 21 ++ library/haproxy/2.7.7/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.8/Dockerfile | 87 ++++++ library/haproxy/2.7.8/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.8/Makefile | 21 ++ library/haproxy/2.7.8/docker-entrypoint.sh | 17 ++ library/haproxy/2.7.9/Dockerfile | 87 ++++++ library/haproxy/2.7.9/Dockerfile-alpine | 100 +++++++ library/haproxy/2.7.9/Makefile | 21 ++ library/haproxy/2.7.9/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.0/Dockerfile | 87 ++++++ library/haproxy/2.8.0/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.0/Makefile | 21 ++ library/haproxy/2.8.0/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.10/Dockerfile | 87 ++++++ library/haproxy/2.8.10/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.10/Makefile | 21 ++ library/haproxy/2.8.10/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.11/Dockerfile | 87 ++++++ library/haproxy/2.8.11/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.11/Makefile | 21 ++ library/haproxy/2.8.11/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.12/Dockerfile | 87 ++++++ library/haproxy/2.8.12/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.12/Makefile | 21 ++ library/haproxy/2.8.12/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.2/Dockerfile | 87 ++++++ library/haproxy/2.8.2/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.2/Makefile | 21 ++ library/haproxy/2.8.2/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.3/Dockerfile | 87 ++++++ library/haproxy/2.8.3/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.3/Makefile | 21 ++ library/haproxy/2.8.3/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.4/Dockerfile | 87 ++++++ library/haproxy/2.8.4/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.4/Makefile | 21 ++ library/haproxy/2.8.4/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.5/Dockerfile | 87 ++++++ library/haproxy/2.8.5/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.5/Makefile | 21 ++ library/haproxy/2.8.5/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.6/Dockerfile | 87 ++++++ library/haproxy/2.8.6/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.6/Makefile | 21 ++ library/haproxy/2.8.6/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.7/Dockerfile | 87 ++++++ library/haproxy/2.8.7/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.7/Makefile | 21 ++ library/haproxy/2.8.7/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.8/Dockerfile | 87 ++++++ library/haproxy/2.8.8/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.8/Makefile | 21 ++ library/haproxy/2.8.8/docker-entrypoint.sh | 17 ++ library/haproxy/2.8.9/Dockerfile | 87 ++++++ library/haproxy/2.8.9/Dockerfile-alpine | 100 +++++++ library/haproxy/2.8.9/Makefile | 21 ++ library/haproxy/2.8.9/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.0/Dockerfile | 87 ++++++ library/haproxy/2.9.0/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.0/Makefile | 21 ++ library/haproxy/2.9.0/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.1/Dockerfile | 87 ++++++ library/haproxy/2.9.1/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.1/Makefile | 21 ++ library/haproxy/2.9.1/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.10/Dockerfile | 87 ++++++ library/haproxy/2.9.10/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.10/Makefile | 21 ++ library/haproxy/2.9.10/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.11/Dockerfile | 87 ++++++ library/haproxy/2.9.11/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.11/Makefile | 21 ++ library/haproxy/2.9.11/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.12/Dockerfile | 87 ++++++ library/haproxy/2.9.12/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.12/Makefile | 21 ++ library/haproxy/2.9.12/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.2/Dockerfile | 87 ++++++ library/haproxy/2.9.2/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.2/Makefile | 21 ++ library/haproxy/2.9.2/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.3/Dockerfile | 87 ++++++ library/haproxy/2.9.3/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.3/Makefile | 21 ++ library/haproxy/2.9.3/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.4/Dockerfile | 87 ++++++ library/haproxy/2.9.4/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.4/Makefile | 21 ++ library/haproxy/2.9.4/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.5/Dockerfile | 87 ++++++ library/haproxy/2.9.5/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.5/Makefile | 21 ++ library/haproxy/2.9.5/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.6/Dockerfile | 87 ++++++ library/haproxy/2.9.6/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.6/Makefile | 21 ++ library/haproxy/2.9.6/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.7/Dockerfile | 87 ++++++ library/haproxy/2.9.7/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.7/Makefile | 21 ++ library/haproxy/2.9.7/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.8/Dockerfile | 87 ++++++ library/haproxy/2.9.8/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.8/Makefile | 21 ++ library/haproxy/2.9.8/docker-entrypoint.sh | 17 ++ library/haproxy/2.9.9/Dockerfile | 87 ++++++ library/haproxy/2.9.9/Dockerfile-alpine | 100 +++++++ library/haproxy/2.9.9/Makefile | 21 ++ library/haproxy/2.9.9/docker-entrypoint.sh | 17 ++ library/haproxy/build.sh | 301 ++++++++++++++++++++ 265 files changed, 15151 insertions(+) create mode 100644 library/haproxy/2.5.0/Dockerfile create mode 100644 library/haproxy/2.5.0/Dockerfile-alpine create mode 100644 library/haproxy/2.5.0/Makefile create mode 100755 library/haproxy/2.5.0/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.1/Dockerfile create mode 100644 library/haproxy/2.5.1/Dockerfile-alpine create mode 100644 library/haproxy/2.5.1/Makefile create mode 100755 library/haproxy/2.5.1/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.10/Dockerfile create mode 100644 library/haproxy/2.5.10/Dockerfile-alpine create mode 100644 library/haproxy/2.5.10/Makefile create mode 100755 library/haproxy/2.5.10/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.11/Dockerfile create mode 100644 library/haproxy/2.5.11/Dockerfile-alpine create mode 100644 library/haproxy/2.5.11/Makefile create mode 100755 library/haproxy/2.5.11/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.12/Dockerfile create mode 100644 library/haproxy/2.5.12/Dockerfile-alpine create mode 100644 library/haproxy/2.5.12/Makefile create mode 100755 library/haproxy/2.5.12/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.13/Dockerfile create mode 100644 library/haproxy/2.5.13/Dockerfile-alpine create mode 100644 library/haproxy/2.5.13/Makefile create mode 100755 library/haproxy/2.5.13/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.14/Dockerfile create mode 100644 library/haproxy/2.5.14/Dockerfile-alpine create mode 100644 library/haproxy/2.5.14/Makefile create mode 100755 library/haproxy/2.5.14/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.2/Dockerfile create mode 100644 library/haproxy/2.5.2/Dockerfile-alpine create mode 100644 library/haproxy/2.5.2/Makefile create mode 100755 library/haproxy/2.5.2/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.3/Dockerfile create mode 100644 library/haproxy/2.5.3/Dockerfile-alpine create mode 100644 library/haproxy/2.5.3/Makefile create mode 100755 library/haproxy/2.5.3/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.4/Dockerfile create mode 100644 library/haproxy/2.5.4/Dockerfile-alpine create mode 100644 library/haproxy/2.5.4/Makefile create mode 100755 library/haproxy/2.5.4/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.5/Dockerfile create mode 100644 library/haproxy/2.5.5/Dockerfile-alpine create mode 100644 library/haproxy/2.5.5/Makefile create mode 100755 library/haproxy/2.5.5/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.6/Dockerfile create mode 100644 library/haproxy/2.5.6/Dockerfile-alpine create mode 100644 library/haproxy/2.5.6/Makefile create mode 100755 library/haproxy/2.5.6/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.7/Dockerfile create mode 100644 library/haproxy/2.5.7/Dockerfile-alpine create mode 100644 library/haproxy/2.5.7/Makefile create mode 100755 library/haproxy/2.5.7/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.8/Dockerfile create mode 100644 library/haproxy/2.5.8/Dockerfile-alpine create mode 100644 library/haproxy/2.5.8/Makefile create mode 100755 library/haproxy/2.5.8/docker-entrypoint.sh create mode 100644 library/haproxy/2.5.9/Dockerfile create mode 100644 library/haproxy/2.5.9/Dockerfile-alpine create mode 100644 library/haproxy/2.5.9/Makefile create mode 100755 library/haproxy/2.5.9/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.0/Dockerfile create mode 100644 library/haproxy/2.6.0/Dockerfile-alpine create mode 100644 library/haproxy/2.6.0/Makefile create mode 100755 library/haproxy/2.6.0/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.10/Dockerfile create mode 100644 library/haproxy/2.6.10/Dockerfile-alpine create mode 100644 library/haproxy/2.6.10/Makefile create mode 100755 library/haproxy/2.6.10/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.11/Dockerfile create mode 100644 library/haproxy/2.6.11/Dockerfile-alpine create mode 100644 library/haproxy/2.6.11/Makefile create mode 100755 library/haproxy/2.6.11/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.12/Dockerfile create mode 100644 library/haproxy/2.6.12/Dockerfile-alpine create mode 100644 library/haproxy/2.6.12/Makefile create mode 100755 library/haproxy/2.6.12/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.13/Dockerfile create mode 100644 library/haproxy/2.6.13/Dockerfile-alpine create mode 100644 library/haproxy/2.6.13/Makefile create mode 100755 library/haproxy/2.6.13/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.14/Dockerfile create mode 100644 library/haproxy/2.6.14/Dockerfile-alpine create mode 100644 library/haproxy/2.6.14/Makefile create mode 100755 library/haproxy/2.6.14/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.15/Dockerfile create mode 100644 library/haproxy/2.6.15/Dockerfile-alpine create mode 100644 library/haproxy/2.6.15/Makefile create mode 100755 library/haproxy/2.6.15/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.16/Dockerfile create mode 100644 library/haproxy/2.6.16/Dockerfile-alpine create mode 100644 library/haproxy/2.6.16/Makefile create mode 100755 library/haproxy/2.6.16/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.17/Dockerfile create mode 100644 library/haproxy/2.6.17/Dockerfile-alpine create mode 100644 library/haproxy/2.6.17/Makefile create mode 100755 library/haproxy/2.6.17/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.18/Dockerfile create mode 100644 library/haproxy/2.6.18/Dockerfile-alpine create mode 100644 library/haproxy/2.6.18/Makefile create mode 100755 library/haproxy/2.6.18/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.19/Dockerfile create mode 100644 library/haproxy/2.6.19/Dockerfile-alpine create mode 100644 library/haproxy/2.6.19/Makefile create mode 100755 library/haproxy/2.6.19/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.20/Dockerfile create mode 100644 library/haproxy/2.6.20/Dockerfile-alpine create mode 100644 library/haproxy/2.6.20/Makefile create mode 100755 library/haproxy/2.6.20/docker-entrypoint.sh create mode 100644 library/haproxy/2.6.3/Dockerfile create mode 100644 library/haproxy/2.6.3/Dockerfile-alpine create mode 100644 library/haproxy/2.6.3/Makefile create mode 100755 library/haproxy/2.6.3/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.0/Dockerfile create mode 100644 library/haproxy/2.7.0/Dockerfile-alpine create mode 100644 library/haproxy/2.7.0/Makefile create mode 100755 library/haproxy/2.7.0/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.1/Dockerfile create mode 100644 library/haproxy/2.7.1/Dockerfile-alpine create mode 100644 library/haproxy/2.7.1/Makefile create mode 100755 library/haproxy/2.7.1/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.10/Dockerfile create mode 100644 library/haproxy/2.7.10/Dockerfile-alpine create mode 100644 library/haproxy/2.7.10/Makefile create mode 100755 library/haproxy/2.7.10/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.11/Dockerfile create mode 100644 library/haproxy/2.7.11/Dockerfile-alpine create mode 100644 library/haproxy/2.7.11/Makefile create mode 100755 library/haproxy/2.7.11/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.12/Dockerfile create mode 100644 library/haproxy/2.7.12/Dockerfile-alpine create mode 100644 library/haproxy/2.7.12/Makefile create mode 100755 library/haproxy/2.7.12/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.2/Dockerfile create mode 100644 library/haproxy/2.7.2/Dockerfile-alpine create mode 100644 library/haproxy/2.7.2/Makefile create mode 100755 library/haproxy/2.7.2/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.3/Dockerfile create mode 100644 library/haproxy/2.7.3/Dockerfile-alpine create mode 100644 library/haproxy/2.7.3/Makefile create mode 100755 library/haproxy/2.7.3/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.4/Dockerfile create mode 100644 library/haproxy/2.7.4/Dockerfile-alpine create mode 100644 library/haproxy/2.7.4/Makefile create mode 100755 library/haproxy/2.7.4/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.5/Dockerfile create mode 100644 library/haproxy/2.7.5/Dockerfile-alpine create mode 100644 library/haproxy/2.7.5/Makefile create mode 100755 library/haproxy/2.7.5/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.6/Dockerfile create mode 100644 library/haproxy/2.7.6/Dockerfile-alpine create mode 100644 library/haproxy/2.7.6/Makefile create mode 100755 library/haproxy/2.7.6/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.7/Dockerfile create mode 100644 library/haproxy/2.7.7/Dockerfile-alpine create mode 100644 library/haproxy/2.7.7/Makefile create mode 100755 library/haproxy/2.7.7/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.8/Dockerfile create mode 100644 library/haproxy/2.7.8/Dockerfile-alpine create mode 100644 library/haproxy/2.7.8/Makefile create mode 100755 library/haproxy/2.7.8/docker-entrypoint.sh create mode 100644 library/haproxy/2.7.9/Dockerfile create mode 100644 library/haproxy/2.7.9/Dockerfile-alpine create mode 100644 library/haproxy/2.7.9/Makefile create mode 100755 library/haproxy/2.7.9/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.0/Dockerfile create mode 100644 library/haproxy/2.8.0/Dockerfile-alpine create mode 100644 library/haproxy/2.8.0/Makefile create mode 100755 library/haproxy/2.8.0/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.10/Dockerfile create mode 100644 library/haproxy/2.8.10/Dockerfile-alpine create mode 100644 library/haproxy/2.8.10/Makefile create mode 100755 library/haproxy/2.8.10/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.11/Dockerfile create mode 100644 library/haproxy/2.8.11/Dockerfile-alpine create mode 100644 library/haproxy/2.8.11/Makefile create mode 100755 library/haproxy/2.8.11/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.12/Dockerfile create mode 100644 library/haproxy/2.8.12/Dockerfile-alpine create mode 100644 library/haproxy/2.8.12/Makefile create mode 100755 library/haproxy/2.8.12/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.2/Dockerfile create mode 100644 library/haproxy/2.8.2/Dockerfile-alpine create mode 100644 library/haproxy/2.8.2/Makefile create mode 100755 library/haproxy/2.8.2/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.3/Dockerfile create mode 100644 library/haproxy/2.8.3/Dockerfile-alpine create mode 100644 library/haproxy/2.8.3/Makefile create mode 100755 library/haproxy/2.8.3/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.4/Dockerfile create mode 100644 library/haproxy/2.8.4/Dockerfile-alpine create mode 100644 library/haproxy/2.8.4/Makefile create mode 100755 library/haproxy/2.8.4/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.5/Dockerfile create mode 100644 library/haproxy/2.8.5/Dockerfile-alpine create mode 100644 library/haproxy/2.8.5/Makefile create mode 100755 library/haproxy/2.8.5/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.6/Dockerfile create mode 100644 library/haproxy/2.8.6/Dockerfile-alpine create mode 100644 library/haproxy/2.8.6/Makefile create mode 100755 library/haproxy/2.8.6/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.7/Dockerfile create mode 100644 library/haproxy/2.8.7/Dockerfile-alpine create mode 100644 library/haproxy/2.8.7/Makefile create mode 100755 library/haproxy/2.8.7/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.8/Dockerfile create mode 100644 library/haproxy/2.8.8/Dockerfile-alpine create mode 100644 library/haproxy/2.8.8/Makefile create mode 100755 library/haproxy/2.8.8/docker-entrypoint.sh create mode 100644 library/haproxy/2.8.9/Dockerfile create mode 100644 library/haproxy/2.8.9/Dockerfile-alpine create mode 100644 library/haproxy/2.8.9/Makefile create mode 100755 library/haproxy/2.8.9/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.0/Dockerfile create mode 100644 library/haproxy/2.9.0/Dockerfile-alpine create mode 100644 library/haproxy/2.9.0/Makefile create mode 100755 library/haproxy/2.9.0/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.1/Dockerfile create mode 100644 library/haproxy/2.9.1/Dockerfile-alpine create mode 100644 library/haproxy/2.9.1/Makefile create mode 100755 library/haproxy/2.9.1/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.10/Dockerfile create mode 100644 library/haproxy/2.9.10/Dockerfile-alpine create mode 100644 library/haproxy/2.9.10/Makefile create mode 100755 library/haproxy/2.9.10/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.11/Dockerfile create mode 100644 library/haproxy/2.9.11/Dockerfile-alpine create mode 100644 library/haproxy/2.9.11/Makefile create mode 100755 library/haproxy/2.9.11/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.12/Dockerfile create mode 100644 library/haproxy/2.9.12/Dockerfile-alpine create mode 100644 library/haproxy/2.9.12/Makefile create mode 100755 library/haproxy/2.9.12/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.2/Dockerfile create mode 100644 library/haproxy/2.9.2/Dockerfile-alpine create mode 100644 library/haproxy/2.9.2/Makefile create mode 100755 library/haproxy/2.9.2/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.3/Dockerfile create mode 100644 library/haproxy/2.9.3/Dockerfile-alpine create mode 100644 library/haproxy/2.9.3/Makefile create mode 100755 library/haproxy/2.9.3/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.4/Dockerfile create mode 100644 library/haproxy/2.9.4/Dockerfile-alpine create mode 100644 library/haproxy/2.9.4/Makefile create mode 100755 library/haproxy/2.9.4/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.5/Dockerfile create mode 100644 library/haproxy/2.9.5/Dockerfile-alpine create mode 100644 library/haproxy/2.9.5/Makefile create mode 100755 library/haproxy/2.9.5/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.6/Dockerfile create mode 100644 library/haproxy/2.9.6/Dockerfile-alpine create mode 100644 library/haproxy/2.9.6/Makefile create mode 100755 library/haproxy/2.9.6/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.7/Dockerfile create mode 100644 library/haproxy/2.9.7/Dockerfile-alpine create mode 100644 library/haproxy/2.9.7/Makefile create mode 100755 library/haproxy/2.9.7/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.8/Dockerfile create mode 100644 library/haproxy/2.9.8/Dockerfile-alpine create mode 100644 library/haproxy/2.9.8/Makefile create mode 100755 library/haproxy/2.9.8/docker-entrypoint.sh create mode 100644 library/haproxy/2.9.9/Dockerfile create mode 100644 library/haproxy/2.9.9/Dockerfile-alpine create mode 100644 library/haproxy/2.9.9/Makefile create mode 100755 library/haproxy/2.9.9/docker-entrypoint.sh create mode 100644 library/haproxy/build.sh diff --git a/library/haproxy/2.5.0/Dockerfile b/library/haproxy/2.5.0/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.0/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.0/Dockerfile-alpine b/library/haproxy/2.5.0/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.0/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.0/Makefile b/library/haproxy/2.5.0/Makefile new file mode 100644 index 0000000..70eca65 --- /dev/null +++ b/library/haproxy/2.5.0/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.0.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.0.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.0/docker-entrypoint.sh b/library/haproxy/2.5.0/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.0/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.1/Dockerfile b/library/haproxy/2.5.1/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.1/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.1/Dockerfile-alpine b/library/haproxy/2.5.1/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.1/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.1/Makefile b/library/haproxy/2.5.1/Makefile new file mode 100644 index 0000000..1e35387 --- /dev/null +++ b/library/haproxy/2.5.1/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.1 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.1.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.1.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.1/docker-entrypoint.sh b/library/haproxy/2.5.1/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.1/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.10/Dockerfile b/library/haproxy/2.5.10/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.10/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.10/Dockerfile-alpine b/library/haproxy/2.5.10/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.10/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.10/Makefile b/library/haproxy/2.5.10/Makefile new file mode 100644 index 0000000..8ba2fc1 --- /dev/null +++ b/library/haproxy/2.5.10/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.10 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.10.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.10.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.10/docker-entrypoint.sh b/library/haproxy/2.5.10/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.10/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.11/Dockerfile b/library/haproxy/2.5.11/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.11/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.11/Dockerfile-alpine b/library/haproxy/2.5.11/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.11/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.11/Makefile b/library/haproxy/2.5.11/Makefile new file mode 100644 index 0000000..4defc80 --- /dev/null +++ b/library/haproxy/2.5.11/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.11 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.11.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.11.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.11/docker-entrypoint.sh b/library/haproxy/2.5.11/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.11/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.12/Dockerfile b/library/haproxy/2.5.12/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.12/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.12/Dockerfile-alpine b/library/haproxy/2.5.12/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.12/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.12/Makefile b/library/haproxy/2.5.12/Makefile new file mode 100644 index 0000000..e539ebd --- /dev/null +++ b/library/haproxy/2.5.12/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.12 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.12.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.12.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.12/docker-entrypoint.sh b/library/haproxy/2.5.12/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.12/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.13/Dockerfile b/library/haproxy/2.5.13/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.13/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.13/Dockerfile-alpine b/library/haproxy/2.5.13/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.13/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.13/Makefile b/library/haproxy/2.5.13/Makefile new file mode 100644 index 0000000..d3374e2 --- /dev/null +++ b/library/haproxy/2.5.13/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.13 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.13 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.13.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.13 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.13.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.13/docker-entrypoint.sh b/library/haproxy/2.5.13/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.13/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.14/Dockerfile b/library/haproxy/2.5.14/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.14/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.14/Dockerfile-alpine b/library/haproxy/2.5.14/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.14/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.14/Makefile b/library/haproxy/2.5.14/Makefile new file mode 100644 index 0000000..c0ccec5 --- /dev/null +++ b/library/haproxy/2.5.14/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.14 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.14 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.14.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.14 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.14.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.14/docker-entrypoint.sh b/library/haproxy/2.5.14/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.14/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.2/Dockerfile b/library/haproxy/2.5.2/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.2/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.2/Dockerfile-alpine b/library/haproxy/2.5.2/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.2/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.2/Makefile b/library/haproxy/2.5.2/Makefile new file mode 100644 index 0000000..8136886 --- /dev/null +++ b/library/haproxy/2.5.2/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.2 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.2.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.2.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.2/docker-entrypoint.sh b/library/haproxy/2.5.2/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.2/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.3/Dockerfile b/library/haproxy/2.5.3/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.3/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.3/Dockerfile-alpine b/library/haproxy/2.5.3/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.3/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.3/Makefile b/library/haproxy/2.5.3/Makefile new file mode 100644 index 0000000..3c3d4e8 --- /dev/null +++ b/library/haproxy/2.5.3/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.3 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.3.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.3.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.3/docker-entrypoint.sh b/library/haproxy/2.5.3/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.3/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.4/Dockerfile b/library/haproxy/2.5.4/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.4/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.4/Dockerfile-alpine b/library/haproxy/2.5.4/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.4/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.4/Makefile b/library/haproxy/2.5.4/Makefile new file mode 100644 index 0000000..fd51800 --- /dev/null +++ b/library/haproxy/2.5.4/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.4 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.4.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.4.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.4/docker-entrypoint.sh b/library/haproxy/2.5.4/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.4/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.5/Dockerfile b/library/haproxy/2.5.5/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.5/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.5/Dockerfile-alpine b/library/haproxy/2.5.5/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.5/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.5/Makefile b/library/haproxy/2.5.5/Makefile new file mode 100644 index 0000000..65005cb --- /dev/null +++ b/library/haproxy/2.5.5/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.5 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.5.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.5.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.5/docker-entrypoint.sh b/library/haproxy/2.5.5/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.5/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.6/Dockerfile b/library/haproxy/2.5.6/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.6/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.6/Dockerfile-alpine b/library/haproxy/2.5.6/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.6/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.6/Makefile b/library/haproxy/2.5.6/Makefile new file mode 100644 index 0000000..409005a --- /dev/null +++ b/library/haproxy/2.5.6/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.6 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.6.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.6.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.6/docker-entrypoint.sh b/library/haproxy/2.5.6/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.6/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.7/Dockerfile b/library/haproxy/2.5.7/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.7/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.7/Dockerfile-alpine b/library/haproxy/2.5.7/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.7/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.7/Makefile b/library/haproxy/2.5.7/Makefile new file mode 100644 index 0000000..fad8f12 --- /dev/null +++ b/library/haproxy/2.5.7/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.7 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.7.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.7.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.7/docker-entrypoint.sh b/library/haproxy/2.5.7/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.7/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.8/Dockerfile b/library/haproxy/2.5.8/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.8/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.8/Dockerfile-alpine b/library/haproxy/2.5.8/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.8/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.8/Makefile b/library/haproxy/2.5.8/Makefile new file mode 100644 index 0000000..d73d156 --- /dev/null +++ b/library/haproxy/2.5.8/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.8 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.8.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.8.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.8/docker-entrypoint.sh b/library/haproxy/2.5.8/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.8/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.5.9/Dockerfile b/library/haproxy/2.5.9/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.5.9/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.5.9/Dockerfile-alpine b/library/haproxy/2.5.9/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.5.9/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.5.9/Makefile b/library/haproxy/2.5.9/Makefile new file mode 100644 index 0000000..4acefc6 --- /dev/null +++ b/library/haproxy/2.5.9/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.5.9 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.5.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.9.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.5.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.5/src/haproxy-2.5.9.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.5.9/docker-entrypoint.sh b/library/haproxy/2.5.9/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.5.9/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.0/Dockerfile b/library/haproxy/2.6.0/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.0/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.0/Dockerfile-alpine b/library/haproxy/2.6.0/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.0/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.0/Makefile b/library/haproxy/2.6.0/Makefile new file mode 100644 index 0000000..d2cad50 --- /dev/null +++ b/library/haproxy/2.6.0/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.0.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.0.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.0/docker-entrypoint.sh b/library/haproxy/2.6.0/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.0/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.10/Dockerfile b/library/haproxy/2.6.10/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.10/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.10/Dockerfile-alpine b/library/haproxy/2.6.10/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.10/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.10/Makefile b/library/haproxy/2.6.10/Makefile new file mode 100644 index 0000000..25601c4 --- /dev/null +++ b/library/haproxy/2.6.10/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.10 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.10.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.10.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.10/docker-entrypoint.sh b/library/haproxy/2.6.10/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.10/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.11/Dockerfile b/library/haproxy/2.6.11/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.11/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.11/Dockerfile-alpine b/library/haproxy/2.6.11/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.11/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.11/Makefile b/library/haproxy/2.6.11/Makefile new file mode 100644 index 0000000..4837b85 --- /dev/null +++ b/library/haproxy/2.6.11/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.11 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.11.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.11.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.11/docker-entrypoint.sh b/library/haproxy/2.6.11/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.11/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.12/Dockerfile b/library/haproxy/2.6.12/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.12/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.12/Dockerfile-alpine b/library/haproxy/2.6.12/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.12/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.12/Makefile b/library/haproxy/2.6.12/Makefile new file mode 100644 index 0000000..6cd02de --- /dev/null +++ b/library/haproxy/2.6.12/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.12 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.12.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.12.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.12/docker-entrypoint.sh b/library/haproxy/2.6.12/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.12/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.13/Dockerfile b/library/haproxy/2.6.13/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.13/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.13/Dockerfile-alpine b/library/haproxy/2.6.13/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.13/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.13/Makefile b/library/haproxy/2.6.13/Makefile new file mode 100644 index 0000000..e1cb168 --- /dev/null +++ b/library/haproxy/2.6.13/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.13 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.13 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.13.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.13 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.13.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.13/docker-entrypoint.sh b/library/haproxy/2.6.13/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.13/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.14/Dockerfile b/library/haproxy/2.6.14/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.14/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.14/Dockerfile-alpine b/library/haproxy/2.6.14/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.14/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.14/Makefile b/library/haproxy/2.6.14/Makefile new file mode 100644 index 0000000..8061029 --- /dev/null +++ b/library/haproxy/2.6.14/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.14 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.14 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.14.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.14 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.14.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.14/docker-entrypoint.sh b/library/haproxy/2.6.14/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.14/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.15/Dockerfile b/library/haproxy/2.6.15/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.15/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.15/Dockerfile-alpine b/library/haproxy/2.6.15/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.15/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.15/Makefile b/library/haproxy/2.6.15/Makefile new file mode 100644 index 0000000..2324cbc --- /dev/null +++ b/library/haproxy/2.6.15/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.15 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.15 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.15.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.15 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.15.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.15/docker-entrypoint.sh b/library/haproxy/2.6.15/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.15/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.16/Dockerfile b/library/haproxy/2.6.16/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.16/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.16/Dockerfile-alpine b/library/haproxy/2.6.16/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.16/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.16/Makefile b/library/haproxy/2.6.16/Makefile new file mode 100644 index 0000000..7cb3a7b --- /dev/null +++ b/library/haproxy/2.6.16/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.16 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.16 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.16.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.16 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.16.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.16/docker-entrypoint.sh b/library/haproxy/2.6.16/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.16/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.17/Dockerfile b/library/haproxy/2.6.17/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.17/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.17/Dockerfile-alpine b/library/haproxy/2.6.17/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.17/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.17/Makefile b/library/haproxy/2.6.17/Makefile new file mode 100644 index 0000000..499fafb --- /dev/null +++ b/library/haproxy/2.6.17/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.17 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.17 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.17.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.17 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.17.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.17/docker-entrypoint.sh b/library/haproxy/2.6.17/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.17/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.18/Dockerfile b/library/haproxy/2.6.18/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.18/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.18/Dockerfile-alpine b/library/haproxy/2.6.18/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.18/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.18/Makefile b/library/haproxy/2.6.18/Makefile new file mode 100644 index 0000000..6140667 --- /dev/null +++ b/library/haproxy/2.6.18/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.18 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.18 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.18.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.18 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.18.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.18/docker-entrypoint.sh b/library/haproxy/2.6.18/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.18/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.19/Dockerfile b/library/haproxy/2.6.19/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.19/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.19/Dockerfile-alpine b/library/haproxy/2.6.19/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.19/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.19/Makefile b/library/haproxy/2.6.19/Makefile new file mode 100644 index 0000000..799575c --- /dev/null +++ b/library/haproxy/2.6.19/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.19 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.19 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.19.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.19 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.19.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.19/docker-entrypoint.sh b/library/haproxy/2.6.19/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.19/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.20/Dockerfile b/library/haproxy/2.6.20/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.20/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.20/Dockerfile-alpine b/library/haproxy/2.6.20/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.20/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.20/Makefile b/library/haproxy/2.6.20/Makefile new file mode 100644 index 0000000..ffb4be4 --- /dev/null +++ b/library/haproxy/2.6.20/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.20 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.20 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.20.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.20 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.20.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.20/docker-entrypoint.sh b/library/haproxy/2.6.20/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.20/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.6.3/Dockerfile b/library/haproxy/2.6.3/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.6.3/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.6.3/Dockerfile-alpine b/library/haproxy/2.6.3/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.6.3/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.6.3/Makefile b/library/haproxy/2.6.3/Makefile new file mode 100644 index 0000000..56bef53 --- /dev/null +++ b/library/haproxy/2.6.3/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.6.3 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.6.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.3.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.6.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.6/src/haproxy-2.6.3.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.6.3/docker-entrypoint.sh b/library/haproxy/2.6.3/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.6.3/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.0/Dockerfile b/library/haproxy/2.7.0/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.0/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.0/Dockerfile-alpine b/library/haproxy/2.7.0/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.0/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.0/Makefile b/library/haproxy/2.7.0/Makefile new file mode 100644 index 0000000..796b5f3 --- /dev/null +++ b/library/haproxy/2.7.0/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.0.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.0.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.0/docker-entrypoint.sh b/library/haproxy/2.7.0/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.0/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.1/Dockerfile b/library/haproxy/2.7.1/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.1/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.1/Dockerfile-alpine b/library/haproxy/2.7.1/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.1/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.1/Makefile b/library/haproxy/2.7.1/Makefile new file mode 100644 index 0000000..e89c05a --- /dev/null +++ b/library/haproxy/2.7.1/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.1 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.1.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.1.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.1/docker-entrypoint.sh b/library/haproxy/2.7.1/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.1/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.10/Dockerfile b/library/haproxy/2.7.10/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.10/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.10/Dockerfile-alpine b/library/haproxy/2.7.10/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.10/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.10/Makefile b/library/haproxy/2.7.10/Makefile new file mode 100644 index 0000000..c28b183 --- /dev/null +++ b/library/haproxy/2.7.10/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.10 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.10.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.10.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.10/docker-entrypoint.sh b/library/haproxy/2.7.10/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.10/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.11/Dockerfile b/library/haproxy/2.7.11/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.11/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.11/Dockerfile-alpine b/library/haproxy/2.7.11/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.11/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.11/Makefile b/library/haproxy/2.7.11/Makefile new file mode 100644 index 0000000..288d420 --- /dev/null +++ b/library/haproxy/2.7.11/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.11 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.11.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.11.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.11/docker-entrypoint.sh b/library/haproxy/2.7.11/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.11/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.12/Dockerfile b/library/haproxy/2.7.12/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.12/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.12/Dockerfile-alpine b/library/haproxy/2.7.12/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.12/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.12/Makefile b/library/haproxy/2.7.12/Makefile new file mode 100644 index 0000000..ab6fcc0 --- /dev/null +++ b/library/haproxy/2.7.12/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.12 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.12.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.12.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.12/docker-entrypoint.sh b/library/haproxy/2.7.12/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.12/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.2/Dockerfile b/library/haproxy/2.7.2/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.2/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.2/Dockerfile-alpine b/library/haproxy/2.7.2/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.2/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.2/Makefile b/library/haproxy/2.7.2/Makefile new file mode 100644 index 0000000..5172423 --- /dev/null +++ b/library/haproxy/2.7.2/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.2 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.2.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.2.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.2/docker-entrypoint.sh b/library/haproxy/2.7.2/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.2/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.3/Dockerfile b/library/haproxy/2.7.3/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.3/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.3/Dockerfile-alpine b/library/haproxy/2.7.3/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.3/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.3/Makefile b/library/haproxy/2.7.3/Makefile new file mode 100644 index 0000000..0c1bd7c --- /dev/null +++ b/library/haproxy/2.7.3/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.3 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.3.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.3.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.3/docker-entrypoint.sh b/library/haproxy/2.7.3/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.3/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.4/Dockerfile b/library/haproxy/2.7.4/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.4/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.4/Dockerfile-alpine b/library/haproxy/2.7.4/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.4/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.4/Makefile b/library/haproxy/2.7.4/Makefile new file mode 100644 index 0000000..68c3d76 --- /dev/null +++ b/library/haproxy/2.7.4/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.4 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.4.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.4.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.4/docker-entrypoint.sh b/library/haproxy/2.7.4/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.4/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.5/Dockerfile b/library/haproxy/2.7.5/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.5/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.5/Dockerfile-alpine b/library/haproxy/2.7.5/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.5/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.5/Makefile b/library/haproxy/2.7.5/Makefile new file mode 100644 index 0000000..a50dd04 --- /dev/null +++ b/library/haproxy/2.7.5/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.5 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.5.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.5.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.5/docker-entrypoint.sh b/library/haproxy/2.7.5/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.5/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.6/Dockerfile b/library/haproxy/2.7.6/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.6/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.6/Dockerfile-alpine b/library/haproxy/2.7.6/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.6/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.6/Makefile b/library/haproxy/2.7.6/Makefile new file mode 100644 index 0000000..786bc44 --- /dev/null +++ b/library/haproxy/2.7.6/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.6 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.6.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.6.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.6/docker-entrypoint.sh b/library/haproxy/2.7.6/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.6/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.7/Dockerfile b/library/haproxy/2.7.7/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.7/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.7/Dockerfile-alpine b/library/haproxy/2.7.7/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.7/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.7/Makefile b/library/haproxy/2.7.7/Makefile new file mode 100644 index 0000000..cd14cec --- /dev/null +++ b/library/haproxy/2.7.7/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.7 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.7.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.7.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.7/docker-entrypoint.sh b/library/haproxy/2.7.7/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.7/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.8/Dockerfile b/library/haproxy/2.7.8/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.8/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.8/Dockerfile-alpine b/library/haproxy/2.7.8/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.8/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.8/Makefile b/library/haproxy/2.7.8/Makefile new file mode 100644 index 0000000..e2bda03 --- /dev/null +++ b/library/haproxy/2.7.8/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.8 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.8.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.8.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.8/docker-entrypoint.sh b/library/haproxy/2.7.8/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.8/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.7.9/Dockerfile b/library/haproxy/2.7.9/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.7.9/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.7.9/Dockerfile-alpine b/library/haproxy/2.7.9/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.7.9/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.7.9/Makefile b/library/haproxy/2.7.9/Makefile new file mode 100644 index 0000000..187b78a --- /dev/null +++ b/library/haproxy/2.7.9/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.7.9 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.7.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.9.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.7.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.7/src/haproxy-2.7.9.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.7.9/docker-entrypoint.sh b/library/haproxy/2.7.9/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.7.9/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.0/Dockerfile b/library/haproxy/2.8.0/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.0/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.0/Dockerfile-alpine b/library/haproxy/2.8.0/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.0/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.0/Makefile b/library/haproxy/2.8.0/Makefile new file mode 100644 index 0000000..38b79eb --- /dev/null +++ b/library/haproxy/2.8.0/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.0.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.0.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.0/docker-entrypoint.sh b/library/haproxy/2.8.0/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.0/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.10/Dockerfile b/library/haproxy/2.8.10/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.10/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.10/Dockerfile-alpine b/library/haproxy/2.8.10/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.10/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.10/Makefile b/library/haproxy/2.8.10/Makefile new file mode 100644 index 0000000..e2b56e5 --- /dev/null +++ b/library/haproxy/2.8.10/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.10 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.10.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.10.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.10/docker-entrypoint.sh b/library/haproxy/2.8.10/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.10/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.11/Dockerfile b/library/haproxy/2.8.11/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.11/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.11/Dockerfile-alpine b/library/haproxy/2.8.11/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.11/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.11/Makefile b/library/haproxy/2.8.11/Makefile new file mode 100644 index 0000000..3561910 --- /dev/null +++ b/library/haproxy/2.8.11/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.11 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.11.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.11.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.11/docker-entrypoint.sh b/library/haproxy/2.8.11/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.11/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.12/Dockerfile b/library/haproxy/2.8.12/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.12/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.12/Dockerfile-alpine b/library/haproxy/2.8.12/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.12/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.12/Makefile b/library/haproxy/2.8.12/Makefile new file mode 100644 index 0000000..2b1130e --- /dev/null +++ b/library/haproxy/2.8.12/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.12 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.12.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.12.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.12/docker-entrypoint.sh b/library/haproxy/2.8.12/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.12/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.2/Dockerfile b/library/haproxy/2.8.2/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.2/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.2/Dockerfile-alpine b/library/haproxy/2.8.2/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.2/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.2/Makefile b/library/haproxy/2.8.2/Makefile new file mode 100644 index 0000000..6970c8c --- /dev/null +++ b/library/haproxy/2.8.2/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.2 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.2.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.2.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.2/docker-entrypoint.sh b/library/haproxy/2.8.2/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.2/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.3/Dockerfile b/library/haproxy/2.8.3/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.3/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.3/Dockerfile-alpine b/library/haproxy/2.8.3/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.3/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.3/Makefile b/library/haproxy/2.8.3/Makefile new file mode 100644 index 0000000..8a6d8fe --- /dev/null +++ b/library/haproxy/2.8.3/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.3 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.3.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.3.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.3/docker-entrypoint.sh b/library/haproxy/2.8.3/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.3/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.4/Dockerfile b/library/haproxy/2.8.4/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.4/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.4/Dockerfile-alpine b/library/haproxy/2.8.4/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.4/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.4/Makefile b/library/haproxy/2.8.4/Makefile new file mode 100644 index 0000000..5e731ed --- /dev/null +++ b/library/haproxy/2.8.4/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.4 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.4.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.4.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.4/docker-entrypoint.sh b/library/haproxy/2.8.4/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.4/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.5/Dockerfile b/library/haproxy/2.8.5/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.5/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.5/Dockerfile-alpine b/library/haproxy/2.8.5/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.5/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.5/Makefile b/library/haproxy/2.8.5/Makefile new file mode 100644 index 0000000..cac270e --- /dev/null +++ b/library/haproxy/2.8.5/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.5 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.5.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.5.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.5/docker-entrypoint.sh b/library/haproxy/2.8.5/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.5/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.6/Dockerfile b/library/haproxy/2.8.6/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.6/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.6/Dockerfile-alpine b/library/haproxy/2.8.6/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.6/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.6/Makefile b/library/haproxy/2.8.6/Makefile new file mode 100644 index 0000000..6804629 --- /dev/null +++ b/library/haproxy/2.8.6/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.6 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.6.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.6.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.6/docker-entrypoint.sh b/library/haproxy/2.8.6/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.6/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.7/Dockerfile b/library/haproxy/2.8.7/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.7/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.7/Dockerfile-alpine b/library/haproxy/2.8.7/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.7/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.7/Makefile b/library/haproxy/2.8.7/Makefile new file mode 100644 index 0000000..dc7095a --- /dev/null +++ b/library/haproxy/2.8.7/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.7 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.7.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.7.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.7/docker-entrypoint.sh b/library/haproxy/2.8.7/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.7/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.8/Dockerfile b/library/haproxy/2.8.8/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.8/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.8/Dockerfile-alpine b/library/haproxy/2.8.8/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.8/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.8/Makefile b/library/haproxy/2.8.8/Makefile new file mode 100644 index 0000000..e8b4936 --- /dev/null +++ b/library/haproxy/2.8.8/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.8 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.8.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.8.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.8/docker-entrypoint.sh b/library/haproxy/2.8.8/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.8/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.8.9/Dockerfile b/library/haproxy/2.8.9/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.8.9/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.8.9/Dockerfile-alpine b/library/haproxy/2.8.9/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.8.9/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.8.9/Makefile b/library/haproxy/2.8.9/Makefile new file mode 100644 index 0000000..991ecb7 --- /dev/null +++ b/library/haproxy/2.8.9/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.8.9 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.8.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.9.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.8.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.8/src/haproxy-2.8.9.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.8.9/docker-entrypoint.sh b/library/haproxy/2.8.9/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.8.9/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.0/Dockerfile b/library/haproxy/2.9.0/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.0/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.0/Dockerfile-alpine b/library/haproxy/2.9.0/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.0/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.0/Makefile b/library/haproxy/2.9.0/Makefile new file mode 100644 index 0000000..323f58b --- /dev/null +++ b/library/haproxy/2.9.0/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.0.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.0 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.0.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.0/docker-entrypoint.sh b/library/haproxy/2.9.0/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.0/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.1/Dockerfile b/library/haproxy/2.9.1/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.1/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.1/Dockerfile-alpine b/library/haproxy/2.9.1/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.1/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.1/Makefile b/library/haproxy/2.9.1/Makefile new file mode 100644 index 0000000..55acd5a --- /dev/null +++ b/library/haproxy/2.9.1/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.1 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.1.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.1 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.1.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.1/docker-entrypoint.sh b/library/haproxy/2.9.1/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.1/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.10/Dockerfile b/library/haproxy/2.9.10/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.10/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.10/Dockerfile-alpine b/library/haproxy/2.9.10/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.10/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.10/Makefile b/library/haproxy/2.9.10/Makefile new file mode 100644 index 0000000..ea89207 --- /dev/null +++ b/library/haproxy/2.9.10/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.10 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.10.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.10 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.10.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.10/docker-entrypoint.sh b/library/haproxy/2.9.10/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.10/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.11/Dockerfile b/library/haproxy/2.9.11/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.11/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.11/Dockerfile-alpine b/library/haproxy/2.9.11/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.11/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.11/Makefile b/library/haproxy/2.9.11/Makefile new file mode 100644 index 0000000..7f8758d --- /dev/null +++ b/library/haproxy/2.9.11/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.11 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.11.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.11 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.11.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.11/docker-entrypoint.sh b/library/haproxy/2.9.11/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.11/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.12/Dockerfile b/library/haproxy/2.9.12/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.12/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.12/Dockerfile-alpine b/library/haproxy/2.9.12/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.12/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.12/Makefile b/library/haproxy/2.9.12/Makefile new file mode 100644 index 0000000..411c761 --- /dev/null +++ b/library/haproxy/2.9.12/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.12 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.12.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.12 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.12.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.12/docker-entrypoint.sh b/library/haproxy/2.9.12/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.12/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.2/Dockerfile b/library/haproxy/2.9.2/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.2/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.2/Dockerfile-alpine b/library/haproxy/2.9.2/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.2/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.2/Makefile b/library/haproxy/2.9.2/Makefile new file mode 100644 index 0000000..ce6606f --- /dev/null +++ b/library/haproxy/2.9.2/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.2 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.2.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.2 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.2.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.2/docker-entrypoint.sh b/library/haproxy/2.9.2/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.2/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.3/Dockerfile b/library/haproxy/2.9.3/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.3/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.3/Dockerfile-alpine b/library/haproxy/2.9.3/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.3/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.3/Makefile b/library/haproxy/2.9.3/Makefile new file mode 100644 index 0000000..2f59c84 --- /dev/null +++ b/library/haproxy/2.9.3/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.3 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.3.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.3 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.3.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.3/docker-entrypoint.sh b/library/haproxy/2.9.3/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.3/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.4/Dockerfile b/library/haproxy/2.9.4/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.4/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.4/Dockerfile-alpine b/library/haproxy/2.9.4/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.4/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.4/Makefile b/library/haproxy/2.9.4/Makefile new file mode 100644 index 0000000..6a3ff32 --- /dev/null +++ b/library/haproxy/2.9.4/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.4 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.4.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.4 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.4.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.4/docker-entrypoint.sh b/library/haproxy/2.9.4/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.4/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.5/Dockerfile b/library/haproxy/2.9.5/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.5/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.5/Dockerfile-alpine b/library/haproxy/2.9.5/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.5/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.5/Makefile b/library/haproxy/2.9.5/Makefile new file mode 100644 index 0000000..d0e78ca --- /dev/null +++ b/library/haproxy/2.9.5/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.5 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.5.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.5 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.5.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.5/docker-entrypoint.sh b/library/haproxy/2.9.5/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.5/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.6/Dockerfile b/library/haproxy/2.9.6/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.6/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.6/Dockerfile-alpine b/library/haproxy/2.9.6/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.6/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.6/Makefile b/library/haproxy/2.9.6/Makefile new file mode 100644 index 0000000..12a3d08 --- /dev/null +++ b/library/haproxy/2.9.6/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.6 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.6.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.6 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.6.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.6/docker-entrypoint.sh b/library/haproxy/2.9.6/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.6/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.7/Dockerfile b/library/haproxy/2.9.7/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.7/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.7/Dockerfile-alpine b/library/haproxy/2.9.7/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.7/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.7/Makefile b/library/haproxy/2.9.7/Makefile new file mode 100644 index 0000000..2b696e4 --- /dev/null +++ b/library/haproxy/2.9.7/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.7 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.7.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.7 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.7.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.7/docker-entrypoint.sh b/library/haproxy/2.9.7/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.7/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.8/Dockerfile b/library/haproxy/2.9.8/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.8/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.8/Dockerfile-alpine b/library/haproxy/2.9.8/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.8/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.8/Makefile b/library/haproxy/2.9.8/Makefile new file mode 100644 index 0000000..17faa42 --- /dev/null +++ b/library/haproxy/2.9.8/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.8 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.8.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.8 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.8.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.8/docker-entrypoint.sh b/library/haproxy/2.9.8/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.8/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/2.9.9/Dockerfile b/library/haproxy/2.9.9/Dockerfile new file mode 100644 index 0000000..2d91362 --- /dev/null +++ b/library/haproxy/2.9.9/Dockerfile @@ -0,0 +1,87 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] diff --git a/library/haproxy/2.9.9/Dockerfile-alpine b/library/haproxy/2.9.9/Dockerfile-alpine new file mode 100644 index 0000000..8bb153a --- /dev/null +++ b/library/haproxy/2.9.9/Dockerfile-alpine @@ -0,0 +1,100 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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/library/haproxy/2.9.9/Makefile b/library/haproxy/2.9.9/Makefile new file mode 100644 index 0000000..b7ec22a --- /dev/null +++ b/library/haproxy/2.9.9/Makefile @@ -0,0 +1,21 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=haproxy +TAG?=2.9.9 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + +default: image + +image: + docker build -t $(IMAGE) -t $(IMAGE)-sid --build-arg HAPROXY_VERSION=2.9.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.9.tar.gz . + +image-alpine: + docker build -t $(IMAGE)-alpine -t $(IMAGE)-alpine3.21 -f Dockerfile-alpine --build-arg HAPROXY_VERSION=2.9.9 --build-arg HAPROXY_URL=https://www.haproxy.org/download/2.9/src/haproxy-2.9.9.tar.gz . +push: + docker push $(IMAGE) + docker push $(IMAGE)-sid + docker push $(IMAGE)-alpine + docker push $(IMAGE)-alpine3.21 diff --git a/library/haproxy/2.9.9/docker-entrypoint.sh b/library/haproxy/2.9.9/docker-entrypoint.sh new file mode 100755 index 0000000..8c2f078 --- /dev/null +++ b/library/haproxy/2.9.9/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let's add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@" diff --git a/library/haproxy/build.sh b/library/haproxy/build.sh new file mode 100644 index 0000000..6c679da --- /dev/null +++ b/library/haproxy/build.sh @@ -0,0 +1,301 @@ +#!/bin/bash + +# Define the range of HAProxy versions +start_version="2.5.0" +end_version="2.9.12" + +# Generate all versions between start_version and end_version +versions=() +current_version="$start_version" +while [[ "$current_version" != "$(echo "$end_version" | awk -F. '{print $1"."$2"."($3+1)}')" ]]; do + versions+=("$current_version") + current_version="$(echo "$current_version" | awk -F. '{if ($3 < 99) {print $1"."$2"."($3+1)} else {print $1"."($2+1)".0"}}')" +done + + +# The static content of docker-entrypoint.sh +docker_entrypoint_content='#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = "haproxy" ]; then + shift # "haproxy" + # if the user wants "haproxy", let'\''s add a couple useful flags + # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") + # -db -- disables background mode + set -- haproxy -W -db "$@" +fi + +exec "$@"' + +# Directory structure generation +for version in "${versions[@]}"; do + haproxy_major_version=$(echo $version | cut -d '.' -f 1,2) + haproxy_url="https://www.haproxy.org/download/$haproxy_major_version/src/haproxy-$version.tar.gz" + + # Check if the version exists + if ! curl --head --silent --fail "$haproxy_url" > /dev/null; then + echo "Skipping version $version as it does not exist." + continue + fi + + # Skip if the directory already exists + if [ -d "$version" ]; then + echo "Skipping version $version as directory already exists." + continue + fi + + # Create version directory + mkdir -p "$version" + + # Generate Dockerfile-alpine + cat > "$version/Dockerfile-alpine" <<'EOF' +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/alpine:3.21 +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apk add --no-cache \ +# @system-ca: https://github.com/docker-library/haproxy/pull/216 + ca-certificates \ + ; + +# roughly, https://git.alpinelinux.org/aports/tree/main/haproxy/haproxy.pre-install?h=3.12-stable +RUN set -eux; \ + addgroup --gid 99 --system haproxy; \ + adduser \ + --disabled-password \ + --home /var/lib/haproxy \ + --ingroup haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + + +# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments +RUN set -eux; \ + \ + apk add --no-cache --virtual .build-deps \ + gcc \ + libc-dev \ + linux-headers \ + lua5.4-dev \ + make \ + openssl \ + openssl-dev \ + pcre2-dev \ + readline-dev \ + tar \ + ; \ + \ + wget -O haproxy.tar.gz "$HAPROXY_URL"; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + \ + makeOpts=' \ + TARGET=linux-musl \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.4 LUA_LIB=/usr/lib/lua5.4 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + \ + EXTRA_OBJS=" \ + " \ + '; \ + \ + nproc="$(getconf _NPROCESSORS_ONLN)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .haproxy-rundeps $runDeps; \ + apk del --no-network .build-deps; \ + \ +# smoke test + haproxy -v + +# https://www.haproxy.org/download/1.8/doc/management.txt +# "4. Stopping and restarting HAProxy" +# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed" +# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process" +STOPSIGNAL SIGUSR1 + +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"] +EOF + + # Generate Dockerfile + cat > "$version/Dockerfile" <<'EOF' +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM lcr.loongnix.cn/library/debian:sid +ARG HAPROXY_VERSION +ARG HAPROXY_URL +# runtime dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + ; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + groupadd --gid 99 --system haproxy; \ + useradd \ + --gid haproxy \ + --home-dir /var/lib/haproxy \ + --no-create-home \ + --system \ + --uid 99 \ + haproxy \ + ; \ + mkdir /var/lib/haproxy; \ + chown haproxy:haproxy /var/lib/haproxy + +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + liblua5.3-dev \ + libpcre2-dev \ + libssl-dev \ + make \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + wget -O haproxy.tar.gz $HAPROXY_URL; \ + mkdir -p /usr/src/haproxy; \ + tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \ + rm haproxy.tar.gz; \ + makeOpts=' \ + TARGET=linux-glibc \ + USE_GETADDRINFO=1 \ + USE_LUA=1 LUA_INC=/usr/include/lua5.3 \ + USE_OPENSSL=1 \ + USE_PCRE2=1 USE_PCRE2_JIT=1 \ + USE_PROMEX=1 \ + EXTRA_OBJS=" \ + " \ + '; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "$dpkgArch" in \ + armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \ + esac; \ + nproc="$(nproc)"; \ + eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \ + eval "make -C /usr/src/haproxy install-bin $makeOpts"; \ + mkdir -p /usr/local/etc/haproxy; \ + cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \ + rm -rf /usr/src/haproxy; \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + haproxy -v + +STOPSIGNAL SIGUSR1 + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +USER haproxy + +CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"] +EOF + + # Generate docker-entrypoint.sh + echo "$docker_entrypoint_content" > "$version/docker-entrypoint.sh" + + # Make docker-entrypoint.sh executable + chmod +x "$version/docker-entrypoint.sh" + + # Generate Makefile + cat > "$version/Makefile" < Date: Mon, 16 Dec 2024 09:31:53 +0800 Subject: [PATCH 02/13] add kubevirt cdi-operator 1.52.0 Signed-off-by: yzewei --- kubevirt/cdi-apiserver/1.52.0/Dockerfile | 11 +++++++++ kubevirt/cdi-apiserver/1.52.0/Makefile | 30 +++++++++++++++++++++++ kubevirt/cdi-operator/1.52.0/Makefile | 31 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 kubevirt/cdi-apiserver/1.52.0/Dockerfile create mode 100644 kubevirt/cdi-apiserver/1.52.0/Makefile create mode 100644 kubevirt/cdi-operator/1.52.0/Makefile diff --git a/kubevirt/cdi-apiserver/1.52.0/Dockerfile b/kubevirt/cdi-apiserver/1.52.0/Dockerfile new file mode 100644 index 0000000..c17c49b --- /dev/null +++ b/kubevirt/cdi-apiserver/1.52.0/Dockerfile @@ -0,0 +1,11 @@ +FROM lcr.loongnix.cn/kubevirt/centos_base:1.52.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY cdi-apiserver /usr/bin/ + +USER 1001 + +WORKDIR /home/cdi-apiserver + +ENTRYPOINT ["/usr/bin/cdi-apiserver","-alsologtostderr"] diff --git a/kubevirt/cdi-apiserver/1.52.0/Makefile b/kubevirt/cdi-apiserver/1.52.0/Makefile new file mode 100644 index 0000000..219cba7 --- /dev/null +++ b/kubevirt/cdi-apiserver/1.52.0/Makefile @@ -0,0 +1,30 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=cdi-apiserver +TAG?=1.52.0 +LATEST?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +download: + wget http://cloud.loongnix.cn/releases/loongarch64/kubevirt/cdi-apiserver/1.52.0/cdi-apiserver + chmod +x cdi-apiserver + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi diff --git a/kubevirt/cdi-operator/1.52.0/Makefile b/kubevirt/cdi-operator/1.52.0/Makefile new file mode 100644 index 0000000..3f26f79 --- /dev/null +++ b/kubevirt/cdi-operator/1.52.0/Makefile @@ -0,0 +1,31 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=cdi-operator +TAG?=1.52.0 +LATEST?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +download: + wget http://cloud.loongnix.cn/releases/loongarch64/kubevirt/cdi-operator/1.52.0/cdi-operator + wget http://cloud.loongnix.cn/releases/loongarch64/kubevirt/csv-generator/1.52.0/csv-generator + chmod +x cdi-operator csv-generator + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi From efca19b8be502baef62acd1c039fc958de26f5f6 Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 16 Dec 2024 09:33:36 +0800 Subject: [PATCH 03/13] add kubevirt cdi-controller 1.52.0' Signed-off-by: yzewei --- kubevirt/cdi-controller/1.52.0/Dockerfile | 11 +++++++++ kubevirt/cdi-controller/1.52.0/Makefile | 30 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 kubevirt/cdi-controller/1.52.0/Dockerfile create mode 100644 kubevirt/cdi-controller/1.52.0/Makefile diff --git a/kubevirt/cdi-controller/1.52.0/Dockerfile b/kubevirt/cdi-controller/1.52.0/Dockerfile new file mode 100644 index 0000000..93fb51f --- /dev/null +++ b/kubevirt/cdi-controller/1.52.0/Dockerfile @@ -0,0 +1,11 @@ +FROM lcr.loongnix.cn/kubevirt/centos_base:1.52.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY cdi-controller /usr/bin/ + +USER 1001 + +WORKDIR /home/cdi-controller + +ENTRYPOINT ["/usr/bin/cdi-controller","-alsologtostderr"] diff --git a/kubevirt/cdi-controller/1.52.0/Makefile b/kubevirt/cdi-controller/1.52.0/Makefile new file mode 100644 index 0000000..d0cb34f --- /dev/null +++ b/kubevirt/cdi-controller/1.52.0/Makefile @@ -0,0 +1,30 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=cdi-controller +TAG?=1.52.0 +LATEST?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +download: + wget http://cloud.loongnix.xa/releases/loongarch64/kubevirt/cdi-controller/1.52.0/cdi-controller + chmod +x cdi-controller + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi From 56a0ec76f75e53ffa8b97905fbc88df15223c126 Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 16 Dec 2024 09:39:32 +0800 Subject: [PATCH 04/13] add kubevirt cdi-operator 1.52.0 Signed-off-by: yzewei --- kubevirt/cdi-operator/1.52.0/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 kubevirt/cdi-operator/1.52.0/Dockerfile diff --git a/kubevirt/cdi-operator/1.52.0/Dockerfile b/kubevirt/cdi-operator/1.52.0/Dockerfile new file mode 100644 index 0000000..4b38e5f --- /dev/null +++ b/kubevirt/cdi-operator/1.52.0/Dockerfile @@ -0,0 +1,13 @@ +FROM cr.loongnix.cn/kubevirt/centos_base:1.52.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY cdi-operator \ + csv-generator \ + /usr/bin/ + +USER 1001 + +WORKDIR /home/cdi-operator + +ENTRYPOINT ["/usr/bin/cdi-operator] From cb341733cdeda4c384a2767222c6bd7c7cb7c73b Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 16 Dec 2024 09:58:31 +0800 Subject: [PATCH 05/13] add cdi-uploadserver 1.52.0 Signed-off-by: yzewei --- kubevirt/cdi-uploadserver/1.52.0/Dockerfile | 14 ++++ kubevirt/cdi-uploadserver/1.52.0/Makefile | 33 ++++++++++ .../cdi-uploadserver/1.52.0/install_rpm.sh | 9 +++ kubevirt/cdi-uploadserver/1.52.0/packages.txt | 65 +++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 kubevirt/cdi-uploadserver/1.52.0/Dockerfile create mode 100644 kubevirt/cdi-uploadserver/1.52.0/Makefile create mode 100755 kubevirt/cdi-uploadserver/1.52.0/install_rpm.sh create mode 100644 kubevirt/cdi-uploadserver/1.52.0/packages.txt diff --git a/kubevirt/cdi-uploadserver/1.52.0/Dockerfile b/kubevirt/cdi-uploadserver/1.52.0/Dockerfile new file mode 100644 index 0000000..6026d82 --- /dev/null +++ b/kubevirt/cdi-uploadserver/1.52.0/Dockerfile @@ -0,0 +1,14 @@ +FROM lcr.loongnix.cn/kubevirt/centos_base:1.52.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY cdi-uploadserver \ + /usr/bin/ + +COPY install_rpm.sh packages.txt / + +RUN ./install_rpm.sh; \ + rm -rf install_rpm.sh packages.txt + + +ENTRYPOINT ["/usr/bin/cdi-uploadserver","-alsologtostderr"] diff --git a/kubevirt/cdi-uploadserver/1.52.0/Makefile b/kubevirt/cdi-uploadserver/1.52.0/Makefile new file mode 100644 index 0000000..7968c1f --- /dev/null +++ b/kubevirt/cdi-uploadserver/1.52.0/Makefile @@ -0,0 +1,33 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=cdi-uploadserver +TAG?=1.52.0 +LATEST?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +download: clean + wget https://github.com/Loongson-Cloud-Community/containerized-data-importer/releases/download/v1.52.0/cdi-uploadserver + chmod +x cdi-uploadserver + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi + +clean: + rm -rf cdi-uploadserver diff --git a/kubevirt/cdi-uploadserver/1.52.0/install_rpm.sh b/kubevirt/cdi-uploadserver/1.52.0/install_rpm.sh new file mode 100755 index 0000000..72b8b99 --- /dev/null +++ b/kubevirt/cdi-uploadserver/1.52.0/install_rpm.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +PACKAGES_FILE="packages.txt" + +packages=$(cat "$PACKAGES_FILE" | tr '\n' ' ') +echo "Downloading $packages" + +dnf install -y $packages + diff --git a/kubevirt/cdi-uploadserver/1.52.0/packages.txt b/kubevirt/cdi-uploadserver/1.52.0/packages.txt new file mode 100644 index 0000000..9d0e42e --- /dev/null +++ b/kubevirt/cdi-uploadserver/1.52.0/packages.txt @@ -0,0 +1,65 @@ +acl +alternatives +basesystem +bash +ca-certificates +coreutils-single +crypto-policies +curl +filesystem +gawk +glib2 +glibc +glibc-common +glibc-minimal-langpack +gmp +gnutls +grep +keyutils-libs +krb5-libs +libacl +libaio +libattr +libblkid +libcap +libcom_err +libcurl-minimal +libffi +libgcc +libgcrypt +libgpg-error +libidn2 +libmount +libnbd +libnghttp2 +libselinux +libsepol +libsigsegv +libsmartcols +libtasn1 +libunistring +libuuid +libverto +libxcrypt +libxml2 +libzstd +lz4-libs +mpfr +ncurses-base +ncurses-libs +nettle +openssl-libs +p11-kit +p11-kit-trust +pcre +pcre2 +qemu-img +readline +sed +setup +systemd-libs +tar +tzdata +vim-minimal +xz-libs +zlib From 8197f434a5ac16657ae49b0d3a65e3add0859937 Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 16 Dec 2024 10:06:20 +0800 Subject: [PATCH 06/13] passwd 1.52.0 1.50.0 server Signed-off-by: yzewei --- kubevirt/passwd/0.50.0/Dockerfile | 13 +++++++++++++ kubevirt/passwd/0.50.0/Makefile | 19 +++++++++++++++++++ kubevirt/passwd/0.52.0/Dockerfile | 13 +++++++++++++ kubevirt/passwd/0.52.0/Makefile | 19 +++++++++++++++++++ kubevirt/passwd/1.52.0/Dockerfile | 13 +++++++++++++ kubevirt/passwd/1.52.0/Makefile | 19 +++++++++++++++++++ kubevirt/passwd/server/Dockerfile | 4 ++-- 7 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 kubevirt/passwd/0.50.0/Dockerfile create mode 100644 kubevirt/passwd/0.50.0/Makefile create mode 100644 kubevirt/passwd/0.52.0/Dockerfile create mode 100644 kubevirt/passwd/0.52.0/Makefile create mode 100644 kubevirt/passwd/1.52.0/Dockerfile create mode 100644 kubevirt/passwd/1.52.0/Makefile diff --git a/kubevirt/passwd/0.50.0/Dockerfile b/kubevirt/passwd/0.50.0/Dockerfile new file mode 100644 index 0000000..05a69ee --- /dev/null +++ b/kubevirt/passwd/0.50.0/Dockerfile @@ -0,0 +1,13 @@ +FROM lcr.loongnix.cn/library/debian:sid + +LABEL maintainer="wangweijie@loongson.cn" + +RUN groupadd nonroot-user -g 1001 &&\ + useradd -m nonroot-user -u 1001 -g 1001 &&\ + usermod -s /bin/bash nonroot-user + +ENV architecture=loongarch64 + +USER 1001 + +CMD ["/bin/bash"] diff --git a/kubevirt/passwd/0.50.0/Makefile b/kubevirt/passwd/0.50.0/Makefile new file mode 100644 index 0000000..d0bbd40 --- /dev/null +++ b/kubevirt/passwd/0.50.0/Makefile @@ -0,0 +1,19 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=passwd +TAG?=0.50.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +image: + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) diff --git a/kubevirt/passwd/0.52.0/Dockerfile b/kubevirt/passwd/0.52.0/Dockerfile new file mode 100644 index 0000000..f922b3a --- /dev/null +++ b/kubevirt/passwd/0.52.0/Dockerfile @@ -0,0 +1,13 @@ +FROM lcr.loongnix.cn/library/debian:sid + +LABEL maintainer="wangweijie@loongson.cn" + +RUN groupadd nonroot-user -g 1001 &&\ + useradd -m nonroot-user -u 1001 -g 1001 &&\ + usermod -s /bin/bash nonroot-user + +ENV architecture=loong64 + +USER 1001 + +CMD ["/bin/bash"] diff --git a/kubevirt/passwd/0.52.0/Makefile b/kubevirt/passwd/0.52.0/Makefile new file mode 100644 index 0000000..fbb6709 --- /dev/null +++ b/kubevirt/passwd/0.52.0/Makefile @@ -0,0 +1,19 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=passwd +TAG?=0.52.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +image: + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) diff --git a/kubevirt/passwd/1.52.0/Dockerfile b/kubevirt/passwd/1.52.0/Dockerfile new file mode 100644 index 0000000..f922b3a --- /dev/null +++ b/kubevirt/passwd/1.52.0/Dockerfile @@ -0,0 +1,13 @@ +FROM lcr.loongnix.cn/library/debian:sid + +LABEL maintainer="wangweijie@loongson.cn" + +RUN groupadd nonroot-user -g 1001 &&\ + useradd -m nonroot-user -u 1001 -g 1001 &&\ + usermod -s /bin/bash nonroot-user + +ENV architecture=loong64 + +USER 1001 + +CMD ["/bin/bash"] diff --git a/kubevirt/passwd/1.52.0/Makefile b/kubevirt/passwd/1.52.0/Makefile new file mode 100644 index 0000000..c1d2e13 --- /dev/null +++ b/kubevirt/passwd/1.52.0/Makefile @@ -0,0 +1,19 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=passwd +TAG?=1.52.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +image: + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) diff --git a/kubevirt/passwd/server/Dockerfile b/kubevirt/passwd/server/Dockerfile index d490dd9..e1304d1 100644 --- a/kubevirt/passwd/server/Dockerfile +++ b/kubevirt/passwd/server/Dockerfile @@ -1,6 +1,6 @@ -FROM lcr.loongnix.cn/openeuler/openeuler:22.03-LTS +FROM lcr.loongnix.cn/kubevirt/centos_base:1.52.0 -LABEL maintainer="zhaixiaojuan@loongson.cn" +LABEL maintainer="wangweijie@loongson.cn" RUN groupadd nonroot-user -g 1001 &&\ useradd nonroot-user -u 1001 -g 1001 &&\ From 64d3ff97af005533e92202b08534b81f59bc39fb Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 16 Dec 2024 17:51:42 +0800 Subject: [PATCH 07/13] update cdi-uploadserver 1.52.0 Signed-off-by: yzewei --- kubevirt/cdi-uploadserver/1.52.0/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubevirt/cdi-uploadserver/1.52.0/Makefile b/kubevirt/cdi-uploadserver/1.52.0/Makefile index 7968c1f..d8d526d 100644 --- a/kubevirt/cdi-uploadserver/1.52.0/Makefile +++ b/kubevirt/cdi-uploadserver/1.52.0/Makefile @@ -12,7 +12,7 @@ LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest default: image download: clean - wget https://github.com/Loongson-Cloud-Community/containerized-data-importer/releases/download/v1.52.0/cdi-uploadserver + unset http_proxy && wget http://cloud.loongnix.xa/releases/loongarch64/kubevirt/cdi-uploadserver/1.52.0/cdi-uploadserver chmod +x cdi-uploadserver image: download From c633b97a5d29ec6f4682e081f759d26f96006461 Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 17 Dec 2024 11:19:27 +0800 Subject: [PATCH 08/13] add virt-controller 0.50.0 0.55.0 0.56.0 0.58.0 Signed-off-by: yzewei --- kubevirt/virt-controller/0.50.0/.version | 1 + kubevirt/virt-controller/0.50.0/Dockerfile | 11 ++++++++ kubevirt/virt-controller/0.50.0/Makefile | 26 ++++++++++++++++++ kubevirt/virt-controller/0.55.0/.version | 1 + kubevirt/virt-controller/0.55.0/Dockerfile | 11 ++++++++ kubevirt/virt-controller/0.55.0/Makefile | 26 ++++++++++++++++++ kubevirt/virt-controller/0.56.0/.version | 1 + kubevirt/virt-controller/0.56.0/Dockerfile | 11 ++++++++ kubevirt/virt-controller/0.56.0/Makefile | 32 ++++++++++++++++++++++ kubevirt/virt-controller/0.58.0/Makefile | 2 +- 10 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 kubevirt/virt-controller/0.50.0/.version create mode 100644 kubevirt/virt-controller/0.50.0/Dockerfile create mode 100644 kubevirt/virt-controller/0.50.0/Makefile create mode 100644 kubevirt/virt-controller/0.55.0/.version create mode 100644 kubevirt/virt-controller/0.55.0/Dockerfile create mode 100644 kubevirt/virt-controller/0.55.0/Makefile create mode 100755 kubevirt/virt-controller/0.56.0/.version create mode 100644 kubevirt/virt-controller/0.56.0/Dockerfile create mode 100644 kubevirt/virt-controller/0.56.0/Makefile diff --git a/kubevirt/virt-controller/0.50.0/.version b/kubevirt/virt-controller/0.50.0/.version new file mode 100644 index 0000000..5280d00 --- /dev/null +++ b/kubevirt/virt-controller/0.50.0/.version @@ -0,0 +1 @@ +v0.50.0-dirty diff --git a/kubevirt/virt-controller/0.50.0/Dockerfile b/kubevirt/virt-controller/0.50.0/Dockerfile new file mode 100644 index 0000000..8995fae --- /dev/null +++ b/kubevirt/virt-controller/0.50.0/Dockerfile @@ -0,0 +1,11 @@ +FROM lcr.loongnix.cn/kubevirt/passwd:0.50.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY .version / + +COPY virt-controller /usr/bin/ + +USER 1001 + +ENTRYPOINT ["/usr/bin/virt-controller"] diff --git a/kubevirt/virt-controller/0.50.0/Makefile b/kubevirt/virt-controller/0.50.0/Makefile new file mode 100644 index 0000000..2313f4a --- /dev/null +++ b/kubevirt/virt-controller/0.50.0/Makefile @@ -0,0 +1,26 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=virt-controller +TAG?=0.50.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +download: + wget "http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller" + chmod +x virt-controller + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + +clean: + rm -f virt-controller diff --git a/kubevirt/virt-controller/0.55.0/.version b/kubevirt/virt-controller/0.55.0/.version new file mode 100644 index 0000000..8e4a6c0 --- /dev/null +++ b/kubevirt/virt-controller/0.55.0/.version @@ -0,0 +1 @@ +v0.55.0 diff --git a/kubevirt/virt-controller/0.55.0/Dockerfile b/kubevirt/virt-controller/0.55.0/Dockerfile new file mode 100644 index 0000000..8995fae --- /dev/null +++ b/kubevirt/virt-controller/0.55.0/Dockerfile @@ -0,0 +1,11 @@ +FROM lcr.loongnix.cn/kubevirt/passwd:0.50.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY .version / + +COPY virt-controller /usr/bin/ + +USER 1001 + +ENTRYPOINT ["/usr/bin/virt-controller"] diff --git a/kubevirt/virt-controller/0.55.0/Makefile b/kubevirt/virt-controller/0.55.0/Makefile new file mode 100644 index 0000000..a9cb4b5 --- /dev/null +++ b/kubevirt/virt-controller/0.55.0/Makefile @@ -0,0 +1,26 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=virt-controller +TAG?=0.55.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +download: + wget "http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.55.0/virt-controller" + chmod +x virt-controller + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + +clean: + rm -f virt-controller diff --git a/kubevirt/virt-controller/0.56.0/.version b/kubevirt/virt-controller/0.56.0/.version new file mode 100755 index 0000000..7bd4123 --- /dev/null +++ b/kubevirt/virt-controller/0.56.0/.version @@ -0,0 +1 @@ +v0.56.0-dirty diff --git a/kubevirt/virt-controller/0.56.0/Dockerfile b/kubevirt/virt-controller/0.56.0/Dockerfile new file mode 100644 index 0000000..6deaa11 --- /dev/null +++ b/kubevirt/virt-controller/0.56.0/Dockerfile @@ -0,0 +1,11 @@ +FROM lcr.loongnix.cn/kubevirt/passwd:server + +LABEL maintainer="wangweijie@loongson.cn" + +COPY .version /.version + +COPY virt-controller /usr/bin/ + +USER 1001 + +ENTRYPOINT ["/usr/bin/virt-controller"] diff --git a/kubevirt/virt-controller/0.56.0/Makefile b/kubevirt/virt-controller/0.56.0/Makefile new file mode 100644 index 0000000..fd97933 --- /dev/null +++ b/kubevirt/virt-controller/0.56.0/Makefile @@ -0,0 +1,32 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=virt-controller +TAG?=0.56.0 +LATEST?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest +DOWNLOAD_URL=http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller +default: image + +download: + wget -O virt-controller $(DOWNLOAD_URL) + chmod +x virt-controller + +image: download + docker build \ + --build-arg http_proxy=$(http_proxy) \ + --build-arg https_proxy=$(https_proxy) \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi diff --git a/kubevirt/virt-controller/0.58.0/Makefile b/kubevirt/virt-controller/0.58.0/Makefile index 1072c25..66dec7a 100644 --- a/kubevirt/virt-controller/0.58.0/Makefile +++ b/kubevirt/virt-controller/0.58.0/Makefile @@ -8,7 +8,7 @@ LATEST?=false IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest -DOWNLOAD_URL=http://cloud.loongnix.cn/releases/loongarch64/kubevirt/kubevirt/0.58.0/openeuler-22.03/virt-controller-v0.58.0-linux-loong64 +DOWNLOAD_URL=http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.58.0/virt-controller default: image download: From 916ea0c1c42a827198f3ce32044f6f4992f044c6 Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 24 Dec 2024 10:02:10 +0800 Subject: [PATCH 09/13] add virt-handler 0.50.0 Signed-off-by: yzewei --- kubevirt/virt-handler/0.50.0/Dockerfile | 48 ++++++++++++++++ kubevirt/virt-handler/0.50.0/Makefile | 32 +++++++++++ kubevirt/virt-handler/0.50.0/ipv4-nat.nft | 6 ++ kubevirt/virt-handler/0.50.0/ipv6-nat.nft | 6 ++ kubevirt/virt-handler/0.50.0/nsswitch.conf | 14 +++++ .../virt-handler/0.50.0/virt_launcher.cil | 56 +++++++++++++++++++ 6 files changed, 162 insertions(+) create mode 100644 kubevirt/virt-handler/0.50.0/Dockerfile create mode 100644 kubevirt/virt-handler/0.50.0/Makefile create mode 100644 kubevirt/virt-handler/0.50.0/ipv4-nat.nft create mode 100644 kubevirt/virt-handler/0.50.0/ipv6-nat.nft create mode 100644 kubevirt/virt-handler/0.50.0/nsswitch.conf create mode 100755 kubevirt/virt-handler/0.50.0/virt_launcher.cil diff --git a/kubevirt/virt-handler/0.50.0/Dockerfile b/kubevirt/virt-handler/0.50.0/Dockerfile new file mode 100644 index 0000000..e498751 --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/Dockerfile @@ -0,0 +1,48 @@ +FROM lcr.loongnix.cn/kubevirt/centos_base:1.52.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY .version / + +COPY virt_launcher.cil / + +COPY nsswitch.conf /etc + + +RUN groupadd qemu -g 107 &&\ + useradd qemu -u 107 -g 107 &&\ + usermod -s /bin/bash qemu &&\ + mkdir -p /etc/nftables + +COPY ipv4-nat.nft /etc/nftables +COPY ipv6-nat.nft /etc/nftables + +RUN cd /etc &&\ + dnf update -y &&\ + dnf install -y bzip2 \ + diffutils \ + iptables \ + jansson \ + libaio \ + libbpf \ + libburn \ + libisoburn \ + libisofs \ + libselinux-utils \ + nftables \ + policycoreutils \ + qemu-img \ + rpm-plugin-selinux \ + selinux-policy \ + selinux-policy-targeted \ + xorriso \ + &&\ +# cp /usr/sbin/iptables /usr/sbin/iptables-legacy &&\ + chmod 755 nftables &&\ + cd / + +COPY virt-handler /usr/bin/ +COPY virt-chroot /usr/bin/ +COPY container-disk /usr/bin/ + +ENTRYPOINT ["/usr/bin/virt-handler"] diff --git a/kubevirt/virt-handler/0.50.0/Makefile b/kubevirt/virt-handler/0.50.0/Makefile new file mode 100644 index 0000000..bde7209 --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/Makefile @@ -0,0 +1,32 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=virt-handler +TAG?=0.50.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +download: clean + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-handler/0.50.0/virt-handler" + chmod 755 virt-handler + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-chroot/0.50.0/virt-chroot" + chmod 755 virt-chroot + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/container-disk/0.50.0/container-disk" + chmod 755 container-disk + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + +clean: + rm -f virt-handler \ + virt-chroot \ + container-disk diff --git a/kubevirt/virt-handler/0.50.0/ipv4-nat.nft b/kubevirt/virt-handler/0.50.0/ipv4-nat.nft new file mode 100644 index 0000000..c335c99 --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/ipv4-nat.nft @@ -0,0 +1,6 @@ +table nat { + chain prerouting { type nat hook prerouting priority -100; } + chain input { type nat hook input priority 100; } + chain output { type nat hook output priority -100; } + chain postrouting { type nat hook postrouting priority 100; } +} diff --git a/kubevirt/virt-handler/0.50.0/ipv6-nat.nft b/kubevirt/virt-handler/0.50.0/ipv6-nat.nft new file mode 100644 index 0000000..6e15bec --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/ipv6-nat.nft @@ -0,0 +1,6 @@ +table ip6 nat { + chain prerouting { type nat hook prerouting priority -100; } + chain input { type nat hook input priority 100; } + chain output { type nat hook output priority -100; } + chain postrouting { type nat hook postrouting priority 100; } +} diff --git a/kubevirt/virt-handler/0.50.0/nsswitch.conf b/kubevirt/virt-handler/0.50.0/nsswitch.conf new file mode 100644 index 0000000..1c85a61 --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/nsswitch.conf @@ -0,0 +1,14 @@ +passwd: files +shadow: files +group: files +hosts: files dns myhostname +services: files +netgroup: +automount: files +aliases: files +ethers: files +gshadow: files +networks: files dns +protocols: files +publickey: files +rpc: files diff --git a/kubevirt/virt-handler/0.50.0/virt_launcher.cil b/kubevirt/virt-handler/0.50.0/virt_launcher.cil new file mode 100755 index 0000000..92d9b9f --- /dev/null +++ b/kubevirt/virt-handler/0.50.0/virt_launcher.cil @@ -0,0 +1,56 @@ +; This is the custom SELinux policy for virt-launcher. This file is hopefully temporary. +; Applications running in regular container usually have container_t as an SELinux type. +; However, some applications running in virt-launcher (namely libvirtd) need more permissions. +(block virt_launcher + ; + ; In the virt_launcher block, everything we define will be prefixed with "virt_launcher." + ; Therefore, every mention of "process" really means "virt_launcher.process". + ; + ; virt_launcher.process is defined as a run-able domain type + (type process) + (roletype system_r process) + (typeattributeset domain (process)) + ; + ; Giving virt_launcher.process the same attributes as container_t + (typeattributeset container_domain (process)) + (typeattributeset container_net_domain (process)) + (typeattributeset svirt_sandbox_domain (process)) + (typeattributeset sandbox_net_domain (process)) + ; This one is particularly important, without it the type would not be mcs-constrained. + ; MCS is leveraged by container_t and others, like us, to prevent cross-pod communication. + (typeattributeset mcs_constrained_type (process)) + ; + ; + ; Adding the permissions missing from container_t to be able to run programs like libvirtd + ; The list of "allow" rules should be as short and as documented as possible + ; + ; + ; Allowing virt-launcher to read files under /proc + ; libvirtd seems to run fine without it, but it will trigger AVCs without the permission. + ; This could potentially be replaced by a dontaudit, here or upstream (better) + (allow process proc_type (file (getattr open read))) + ; + ; Allowing libvirtd to relay network-related debug messages + ; libvirtd seems to run fine without it. + ; There is already a dontaudit covering it, removing the permission would not trigger AVCs. + ; However, without this permission, there would be a lot of warnings poluting the logs. + (allow process self (netlink_audit_socket (nlmsg_relay))) + ; + ; Allowing tun sockets to be relabelled from "virt_launcher.process" to itself. + ; That might seem useless, but when libvirtd adds a tun socket to a network multiqueue, + ; that triggers a relabelling, even if the label is already correct. + ; "relabelfrom" and "relabelto" were added upstream and won't be necessary in the future. + ; It is unclear if "attach_queue" is actually needed + (allow process self (tun_socket (relabelfrom relabelto attach_queue))) + ; + ; Allowing libvirtd to access the hugetlbfs to setup huge tables. + ; Huge tables won't work without it, unless the memory backend is memfd. + ; The 2 following rules could be removed if memfd was the only supported memoty backend. + (allow process hugetlbfs_t (dir (add_name create write remove_name rmdir setattr))) + (allow process hugetlbfs_t (file (create unlink))) + ; + ; This is needed to allow virtiofs to mount filesystem and access NFS + (allow process nfs_t (dir (mounton))) + (allow process proc_t (dir (mounton))) + (allow process proc_t (filesystem (mount unmount))) +) From 4ca4685c838b57e449b611c7d519a47049754711 Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 24 Dec 2024 10:29:44 +0800 Subject: [PATCH 10/13] add kubevirt/virt-operator:0.50.0 Signed-off-by: yzewei --- kubevirt/cdi-controller/1.52.0/Makefile | 2 +- kubevirt/cdi-uploadserver/1.52.0/Makefile | 2 +- kubevirt/virt-controller/0.50.0/Makefile | 2 +- kubevirt/virt-controller/0.55.0/Makefile | 2 +- kubevirt/virt-controller/0.56.0/Makefile | 2 +- kubevirt/virt-controller/0.58.0/Makefile | 2 +- kubevirt/virt-operator/0.50.0/Dockerfile | 13 ++++++++++ kubevirt/virt-operator/0.50.0/Makefile | 29 +++++++++++++++++++++++ 8 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 kubevirt/virt-operator/0.50.0/Dockerfile create mode 100644 kubevirt/virt-operator/0.50.0/Makefile diff --git a/kubevirt/cdi-controller/1.52.0/Makefile b/kubevirt/cdi-controller/1.52.0/Makefile index d0cb34f..460b431 100644 --- a/kubevirt/cdi-controller/1.52.0/Makefile +++ b/kubevirt/cdi-controller/1.52.0/Makefile @@ -12,7 +12,7 @@ LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest default: image download: - wget http://cloud.loongnix.xa/releases/loongarch64/kubevirt/cdi-controller/1.52.0/cdi-controller + wget http://cloud.loongnix.cn/releases/loongarch64/kubevirt/cdi-controller/1.52.0/cdi-controller chmod +x cdi-controller image: download diff --git a/kubevirt/cdi-uploadserver/1.52.0/Makefile b/kubevirt/cdi-uploadserver/1.52.0/Makefile index d8d526d..683893c 100644 --- a/kubevirt/cdi-uploadserver/1.52.0/Makefile +++ b/kubevirt/cdi-uploadserver/1.52.0/Makefile @@ -12,7 +12,7 @@ LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest default: image download: clean - unset http_proxy && wget http://cloud.loongnix.xa/releases/loongarch64/kubevirt/cdi-uploadserver/1.52.0/cdi-uploadserver + unset http_proxy && wget http://cloud.loongnix.cn/releases/loongarch64/kubevirt/cdi-uploadserver/1.52.0/cdi-uploadserver chmod +x cdi-uploadserver image: download diff --git a/kubevirt/virt-controller/0.50.0/Makefile b/kubevirt/virt-controller/0.50.0/Makefile index 2313f4a..788cb15 100644 --- a/kubevirt/virt-controller/0.50.0/Makefile +++ b/kubevirt/virt-controller/0.50.0/Makefile @@ -11,7 +11,7 @@ IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) default: image download: - wget "http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller" + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller" chmod +x virt-controller image: download diff --git a/kubevirt/virt-controller/0.55.0/Makefile b/kubevirt/virt-controller/0.55.0/Makefile index a9cb4b5..9774f04 100644 --- a/kubevirt/virt-controller/0.55.0/Makefile +++ b/kubevirt/virt-controller/0.55.0/Makefile @@ -11,7 +11,7 @@ IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) default: image download: - wget "http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.55.0/virt-controller" + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-controller/0.55.0/virt-controller" chmod +x virt-controller image: download diff --git a/kubevirt/virt-controller/0.56.0/Makefile b/kubevirt/virt-controller/0.56.0/Makefile index fd97933..3cc461f 100644 --- a/kubevirt/virt-controller/0.56.0/Makefile +++ b/kubevirt/virt-controller/0.56.0/Makefile @@ -8,7 +8,7 @@ LATEST?=true IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest -DOWNLOAD_URL=http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller +DOWNLOAD_URL=http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-controller/0.50.0/virt-controller default: image download: diff --git a/kubevirt/virt-controller/0.58.0/Makefile b/kubevirt/virt-controller/0.58.0/Makefile index 66dec7a..57bc3f7 100644 --- a/kubevirt/virt-controller/0.58.0/Makefile +++ b/kubevirt/virt-controller/0.58.0/Makefile @@ -8,7 +8,7 @@ LATEST?=false IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest -DOWNLOAD_URL=http://cloud.loongnix.xa/releases/loongarch64/kubevirt/virt-controller/0.58.0/virt-controller +DOWNLOAD_URL=http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-controller/0.58.0/virt-controller default: image download: diff --git a/kubevirt/virt-operator/0.50.0/Dockerfile b/kubevirt/virt-operator/0.50.0/Dockerfile new file mode 100644 index 0000000..6256ee1 --- /dev/null +++ b/kubevirt/virt-operator/0.50.0/Dockerfile @@ -0,0 +1,13 @@ +FROM lcr.loongnix.cn/kubevirt/passwd:0.50.0 + +LABEL maintainer="wangweijie@loongson.cn" + +COPY .version / + +COPY ./virt-operator /usr/bin/ + +COPY ./csv-generator /usr/bin/ + +USER 1001 + +ENTRYPOINT ["/usr/bin/virt-operator"] diff --git a/kubevirt/virt-operator/0.50.0/Makefile b/kubevirt/virt-operator/0.50.0/Makefile new file mode 100644 index 0000000..13f2673 --- /dev/null +++ b/kubevirt/virt-operator/0.50.0/Makefile @@ -0,0 +1,29 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=kubevirt +REPOSITORY?=virt-operator +TAG?=0.50.0 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +download: + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/virt-operator/0.50.0/virt-operator" + wget "http://cloud.loongnix.cn/releases/loongarch64/kubevirt/csv-generator/0.50.0/csv-generator" + chmod +x virt-operator + chmod +x csv-generator + +image: download + docker build \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + +clean: + rm -f virt-operator \ + csv-generator From 776969a4db9bed93fa126fb041deed57de95d7d0 Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 24 Dec 2024 11:25:41 +0800 Subject: [PATCH 11/13] update php 7.4.30-fpm-alpine Signed-off-by: yzewei --- library/php/7.4.30-fpm-alpine/Dockerfile | 31 ++++++++++++++++++------ library/php/7.4.30-fpm-alpine/Makefile | 2 ++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/library/php/7.4.30-fpm-alpine/Dockerfile b/library/php/7.4.30-fpm-alpine/Dockerfile index 5fd24ba..56fbfba 100644 --- a/library/php/7.4.30-fpm-alpine/Dockerfile +++ b/library/php/7.4.30-fpm-alpine/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM lcr.loongnix.cn/library/alpine:3.19 +FROM lcr.loongnix.cn/library/alpine:3.21 MAINTAINER Xuhui Qiang # dependencies required for running "phpize" @@ -27,8 +27,9 @@ RUN apk add --no-cache \ tar \ xz \ patch \ + wget # https://github.com/docker-library/php/issues/494 - openssl +# openssl # ensure www-data user exists RUN set -eux; \ @@ -38,6 +39,21 @@ RUN set -eux; \ # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable # https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable +# 编译openssl1.x +RUN apk add --no-cache --virtual .build-deps build-base \ + perl \ + bash \ + zlib-dev \ + make \ + gcc \ + linux-headers && rm -rf /var/cache/apk/* && \ + mkdir -p /openssl && cd /openssl && wget https://www.openssl.org/source/openssl-1.1.1u.tar.gz && \ + tar -zxvf openssl-1.1.1u.tar.gz && \ + cd openssl-1.1.1u && \ + ./config && make && make install && \ + rm -rf /openssl && apk del .build-deps && \ + rm -rf /var/cache/apk/* + ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ @@ -70,7 +86,7 @@ RUN set -eux; \ mkdir -p /usr/src; \ cd /usr/src; \ \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ + wget -O php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -104,9 +120,9 @@ RUN set -eux; \ libxml2-dev \ linux-headers \ oniguruma-dev \ - openssl-dev \ readline-dev \ sqlite-dev \ + php-pear \ ; \ \ # make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) @@ -130,6 +146,7 @@ RUN set -eux; \ \ # make sure invalid --configure-flags are fatal errors instead of just warnings --enable-option-checking=fatal \ + --with-openssl \ \ # https://github.com/docker-library/php/issues/439 --with-mhash \ @@ -202,9 +219,9 @@ RUN set -eux; \ apk del --no-network .build-deps; \ \ # update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ +# pecl update-channels; \ +# rm -rf /tmp/pear ~/.pearrc; \ +# \ # smoke test php --version diff --git a/library/php/7.4.30-fpm-alpine/Makefile b/library/php/7.4.30-fpm-alpine/Makefile index f9f1144..28387ae 100644 --- a/library/php/7.4.30-fpm-alpine/Makefile +++ b/library/php/7.4.30-fpm-alpine/Makefile @@ -12,6 +12,8 @@ default: image image: docker build \ + --build-arg http_proxy=$(http_proxy) \ + --build-arg https_proxy=$(https_proxy) \ -t $(IMAGE) \ . From 6e9b96d74cddb13c775236ae3575d129e4a7c3dd Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 7 Jan 2025 09:26:44 +0800 Subject: [PATCH 12/13] add nextcloud 30 Signed-off-by: yzewei --- library/nextcloud/30/Dockerfile | 175 +++++++++++ library/nextcloud/30/Makefile | 20 ++ .../30/config/apache-pretty-urls.config.php | 4 + library/nextcloud/30/config/apcu.config.php | 4 + library/nextcloud/30/config/apps.config.php | 15 + library/nextcloud/30/config/autoconfig.php | 41 +++ library/nextcloud/30/config/redis.config.php | 17 + .../30/config/reverse-proxy.config.php | 35 +++ library/nextcloud/30/config/s3.config.php | 48 +++ library/nextcloud/30/config/smtp.config.php | 22 ++ library/nextcloud/30/config/swift.config.php | 31 ++ .../30/config/upgrade-disable-web.config.php | 4 + library/nextcloud/30/cron.sh | 4 + library/nextcloud/30/entrypoint.sh | 293 ++++++++++++++++++ library/nextcloud/30/upgrade.exclude | 6 + 15 files changed, 719 insertions(+) create mode 100644 library/nextcloud/30/Dockerfile create mode 100644 library/nextcloud/30/Makefile create mode 100644 library/nextcloud/30/config/apache-pretty-urls.config.php create mode 100644 library/nextcloud/30/config/apcu.config.php create mode 100644 library/nextcloud/30/config/apps.config.php create mode 100644 library/nextcloud/30/config/autoconfig.php create mode 100644 library/nextcloud/30/config/redis.config.php create mode 100644 library/nextcloud/30/config/reverse-proxy.config.php create mode 100644 library/nextcloud/30/config/s3.config.php create mode 100644 library/nextcloud/30/config/smtp.config.php create mode 100644 library/nextcloud/30/config/swift.config.php create mode 100644 library/nextcloud/30/config/upgrade-disable-web.config.php create mode 100755 library/nextcloud/30/cron.sh create mode 100755 library/nextcloud/30/entrypoint.sh create mode 100644 library/nextcloud/30/upgrade.exclude diff --git a/library/nextcloud/30/Dockerfile b/library/nextcloud/30/Dockerfile new file mode 100644 index 0000000..ccfa711 --- /dev/null +++ b/library/nextcloud/30/Dockerfile @@ -0,0 +1,175 @@ +# DO NOT EDIT: created by update.sh from Dockerfile-debian.template +#FROM php:8.2-apache-bookworm +FROM lcr.loongnix.cn/library/php:8.2-apache-sid + +# entrypoint.sh and cron.sh dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + busybox-static \ + bzip2 \ + libldap-common \ + libmagickcore-7.q16-10-extra \ + rsync \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /var/spool/cron/crontabs; \ + echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data + +# install the PHP extensions we need +# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html +ENV PHP_MEMORY_LIMIT 512M +ENV PHP_UPLOAD_LIMIT 512M +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + libevent-dev \ + libfreetype6-dev \ + libgmp-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmagickwand-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libwebp-dev \ + libxml2-dev \ + libzip-dev \ + ; \ + \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure ftp --with-openssl-dir=/usr; \ + docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-install -j "$(nproc)" \ + bcmath \ + exif \ + ftp \ + gd \ + gmp \ + intl \ + ldap \ + opcache \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + sysvsem \ + zip \ + ; \ + \ +# pecl will claim success even if one install fails, so we need to perform each install separately + pecl install APCu-5.1.24; \ + pecl install imagick-3.7.0; \ + pecl install memcached-3.3.0; \ + pecl install redis-6.1.0; \ + \ + docker-php-ext-enable \ + apcu \ + imagick \ + memcached \ + redis \ + ; \ + rm -r /tmp/pear; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +# set recommended PHP.ini settings +# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache +RUN { \ + echo 'opcache.enable=1'; \ + echo 'opcache.interned_strings_buffer=32'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.jit=1255'; \ + echo 'opcache.jit_buffer_size=128M'; \ + } > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \ + \ + echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \ + \ + { \ + echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ + echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ + echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ + } > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \ + \ + mkdir /var/www/data; \ + mkdir -p /docker-entrypoint-hooks.d/pre-installation \ + /docker-entrypoint-hooks.d/post-installation \ + /docker-entrypoint-hooks.d/pre-upgrade \ + /docker-entrypoint-hooks.d/post-upgrade \ + /docker-entrypoint-hooks.d/before-starting; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html + +RUN a2enmod headers rewrite remoteip ; \ + { \ + echo 'RemoteIPHeader X-Real-IP'; \ + echo 'RemoteIPInternalProxy 10.0.0.0/8'; \ + echo 'RemoteIPInternalProxy 172.16.0.0/12'; \ + echo 'RemoteIPInternalProxy 192.168.0.0/16'; \ + } > /etc/apache2/conf-available/remoteip.conf; \ + a2enconf remoteip + +# set apache config LimitRequestBody +ENV APACHE_BODY_LIMIT 1073741824 +RUN { \ + echo 'LimitRequestBody ${APACHE_BODY_LIMIT}'; \ + } > /etc/apache2/conf-available/apache-limits.conf; \ + a2enconf apache-limits + +ENV NEXTCLOUD_VERSION 30.0.4 + +RUN set -ex; \ + fetchDeps=" \ + gnupg \ + dirmngr \ + "; \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + \ + curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2"; \ + curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-30.0.4.tar.bz2.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ +# gpg key from https://nextcloud.com/nextcloud.asc + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ + gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ + gpgconf --kill all; \ + rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ + rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ + mkdir -p /usr/src/nextcloud/data; \ + mkdir -p /usr/src/nextcloud/custom_apps; \ + chmod +x /usr/src/nextcloud/occ; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ + rm -rf /var/lib/apt/lists/* + +COPY *.sh upgrade.exclude / +COPY config/* /usr/src/nextcloud/config/ + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/library/nextcloud/30/Makefile b/library/nextcloud/30/Makefile new file mode 100644 index 0000000..b770dc5 --- /dev/null +++ b/library/nextcloud/30/Makefile @@ -0,0 +1,20 @@ +# This file is generated by the template. + +REGISTRY?=lcr.loongnix.cn +ORGANIZATION?=library +REPOSITORY?=nextcloud +TAG?=30 + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) + + +default: image + +image: + docker build \ + --build-arg https_proxy=$(https_proxy) \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) diff --git a/library/nextcloud/30/config/apache-pretty-urls.config.php b/library/nextcloud/30/config/apache-pretty-urls.config.php new file mode 100644 index 0000000..72da1d8 --- /dev/null +++ b/library/nextcloud/30/config/apache-pretty-urls.config.php @@ -0,0 +1,4 @@ + '/', +); diff --git a/library/nextcloud/30/config/apcu.config.php b/library/nextcloud/30/config/apcu.config.php new file mode 100644 index 0000000..69fed87 --- /dev/null +++ b/library/nextcloud/30/config/apcu.config.php @@ -0,0 +1,4 @@ + '\OC\Memcache\APCu', +); diff --git a/library/nextcloud/30/config/apps.config.php b/library/nextcloud/30/config/apps.config.php new file mode 100644 index 0000000..4c37f72 --- /dev/null +++ b/library/nextcloud/30/config/apps.config.php @@ -0,0 +1,15 @@ + array ( + 0 => array ( + 'path' => OC::$SERVERROOT.'/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => array ( + 'path' => OC::$SERVERROOT.'/custom_apps', + 'url' => '/custom_apps', + 'writable' => true, + ), + ), +); diff --git a/library/nextcloud/30/config/autoconfig.php b/library/nextcloud/30/config/autoconfig.php new file mode 100644 index 0000000..92ad2a1 --- /dev/null +++ b/library/nextcloud/30/config/autoconfig.php @@ -0,0 +1,41 @@ + '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => getenv('REDIS_HOST'), + 'password' => getenv('REDIS_HOST_PASSWORD_FILE') ? trim(file_get_contents(getenv('REDIS_HOST_PASSWORD_FILE'))) : (string) getenv('REDIS_HOST_PASSWORD'), + ), + ); + + if (getenv('REDIS_HOST_PORT') !== false) { + $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); + } elseif (getenv('REDIS_HOST')[0] != '/') { + $CONFIG['redis']['port'] = 6379; + } +} diff --git a/library/nextcloud/30/config/reverse-proxy.config.php b/library/nextcloud/30/config/reverse-proxy.config.php new file mode 100644 index 0000000..30c660f --- /dev/null +++ b/library/nextcloud/30/config/reverse-proxy.config.php @@ -0,0 +1,35 @@ + array( + 'class' => '\OC\Files\ObjectStore\S3', + 'arguments' => array( + 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), + 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', + 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', + 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', + 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', + 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", + 'autocreate' => strtolower($autocreate) !== 'false', + 'use_ssl' => strtolower($use_ssl) !== 'false', + // required for some non Amazon S3 implementations + 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', + // required for older protocol versions + 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' + ) + ) + ); + + if (getenv('OBJECTSTORE_S3_KEY_FILE')) { + $CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE'))); + } elseif (getenv('OBJECTSTORE_S3_KEY')) { + $CONFIG['objectstore']['arguments']['key'] = getenv('OBJECTSTORE_S3_KEY'); + } else { + $CONFIG['objectstore']['arguments']['key'] = ''; + } + + if (getenv('OBJECTSTORE_S3_SECRET_FILE')) { + $CONFIG['objectstore']['arguments']['secret'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SECRET_FILE'))); + } elseif (getenv('OBJECTSTORE_S3_SECRET')) { + $CONFIG['objectstore']['arguments']['secret'] = getenv('OBJECTSTORE_S3_SECRET'); + } else { + $CONFIG['objectstore']['arguments']['secret'] = ''; + } + + if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) { + $CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE'))); + } elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) { + $CONFIG['objectstore']['arguments']['sse_c_key'] = getenv('OBJECTSTORE_S3_SSE_C_KEY'); + } +} diff --git a/library/nextcloud/30/config/smtp.config.php b/library/nextcloud/30/config/smtp.config.php new file mode 100644 index 0000000..66a2ef7 --- /dev/null +++ b/library/nextcloud/30/config/smtp.config.php @@ -0,0 +1,22 @@ + 'smtp', + 'mail_smtphost' => getenv('SMTP_HOST'), + 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), + 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', + 'mail_smtpauth' => getenv('SMTP_NAME') && (getenv('SMTP_PASSWORD') || getenv('SMTP_PASSWORD_FILE')), + 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', + 'mail_smtpname' => getenv('SMTP_NAME') ?: '', + 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), + 'mail_domain' => getenv('MAIL_DOMAIN'), + ); + + if (getenv('SMTP_PASSWORD_FILE')) { + $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); + } elseif (getenv('SMTP_PASSWORD')) { + $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); + } else { + $CONFIG['mail_smtppassword'] = ''; + } +} diff --git a/library/nextcloud/30/config/swift.config.php b/library/nextcloud/30/config/swift.config.php new file mode 100644 index 0000000..47ada56 --- /dev/null +++ b/library/nextcloud/30/config/swift.config.php @@ -0,0 +1,31 @@ + [ + 'class' => 'OC\\Files\\ObjectStore\\Swift', + 'arguments' => [ + 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', + 'user' => [ + 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), + 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), + 'domain' => [ + 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', + ], + ], + 'scope' => [ + 'project' => [ + 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), + 'domain' => [ + 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', + ], + ], + ], + 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', + 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), + 'url' => getenv('OBJECTSTORE_SWIFT_URL'), + 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), + ] + ] + ); +} diff --git a/library/nextcloud/30/config/upgrade-disable-web.config.php b/library/nextcloud/30/config/upgrade-disable-web.config.php new file mode 100644 index 0000000..cb00b43 --- /dev/null +++ b/library/nextcloud/30/config/upgrade-disable-web.config.php @@ -0,0 +1,4 @@ + true, +); diff --git a/library/nextcloud/30/cron.sh b/library/nextcloud/30/cron.sh new file mode 100755 index 0000000..b4cd9af --- /dev/null +++ b/library/nextcloud/30/cron.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec busybox crond -f -L /dev/stdout diff --git a/library/nextcloud/30/entrypoint.sh b/library/nextcloud/30/entrypoint.sh new file mode 100755 index 0000000..8e178f2 --- /dev/null +++ b/library/nextcloud/30/entrypoint.sh @@ -0,0 +1,293 @@ +#!/bin/sh +set -eu + +# version_greater A B returns whether A > B +version_greater() { + [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] +} + +# return true if specified directory is empty +directory_empty() { + [ -z "$(ls -A "$1/")" ] +} + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p "$user" -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +# Execute all executable files in a given directory in alphanumeric order +run_path() { + local hook_folder_path="/docker-entrypoint-hooks.d/$1" + local return_code=0 + + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" + return 0 + fi + + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + + ( + find "${hook_folder_path}" -maxdepth 1 -iname '*.sh' '(' -type f -o -type l ')' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" + continue + fi + + echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\"" + + run_as "${script_file_path}" || return_code="$?" + + if [ "${return_code}" -ne "0" ]; then + echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}" + exit 1 + fi + + echo "==> Finished the script: \"${script_file_path}\"" + done + ) +} + +# usage: file_env VAR [DEFAULT] +# ie: file_env 'XYZ_DB_PASSWORD' 'example' +# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of +# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) +file_env() { + local var="$1" + local fileVar="${var}_FILE" + local def="${2:-}" + local varValue=$(env | grep -E "^${var}=" | sed -E -e "s/^${var}=//") + local fileVarValue=$(env | grep -E "^${fileVar}=" | sed -E -e "s/^${fileVar}=//") + if [ -n "${varValue}" ] && [ -n "${fileVarValue}" ]; then + echo >&2 "error: both $var and $fileVar are set (but are exclusive)" + exit 1 + fi + if [ -n "${varValue}" ]; then + export "$var"="${varValue}" + elif [ -n "${fileVarValue}" ]; then + export "$var"="$(cat "${fileVarValue}")" + elif [ -n "${def}" ]; then + export "$var"="$def" + fi + unset "$fileVar" +} + +if expr "$1" : "apache" 1>/dev/null; then + if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then + a2disconf remoteip + fi +fi + +if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" + + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + user="${user#'#'}" + group="${group#'#'}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi + + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + file_env REDIS_HOST_PASSWORD + echo 'session.save_handler = redis' + # check if redis host is an unix socket path + if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then + if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then + echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\"" + else + echo "session.save_path = \"unix://${REDIS_HOST}\"" + fi + # check if redis password has been set + elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\"" + else + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + + # If another process is syncing the html folder, wait for + # it to be done, then escape initalization. + ( + if ! flock -n 9; then + # If we couldn't get it immediately, show a message, then wait for real + echo "Another process is initializing Nextcloud. Waiting..." + flock 9 + fi + + installed_version="0.0.0.0" + if [ -f /var/www/html/version.php ]; then + # shellcheck disable=SC2016 + installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + fi + # shellcheck disable=SC2016 + image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')" + + if version_greater "$installed_version" "$image_version"; then + echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?" + exit 1 + fi + + if version_greater "$image_version" "$installed_version"; then + echo "Initializing nextcloud $image_version ..." + if [ "$installed_version" != "0.0.0.0" ]; then + if [ "${image_version%%.*}" -gt "$((${installed_version%%.*} + 1))" ]; then + echo "Can't start Nextcloud because upgrading from $installed_version to $image_version is not supported." + echo "It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16." + exit 1 + fi + echo "Upgrading nextcloud from $installed_version ..." + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + fi + if [ "$(id -u)" = 0 ]; then + rsync_options="-rlDog --chown $user:$group" + else + rsync_options="-rlD" + fi + + rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ + for dir in config data custom_apps themes; do + if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then + rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + fi + done + rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ + + # Install + if [ "$installed_version" = "0.0.0.0" ]; then + echo "New nextcloud instance" + + file_env NEXTCLOUD_ADMIN_PASSWORD + file_env NEXTCLOUD_ADMIN_USER + + install=false + if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then + # shellcheck disable=SC2016 + install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"' + if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then + # shellcheck disable=SC2016 + install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"' + fi + + file_env MYSQL_DATABASE + file_env MYSQL_PASSWORD + file_env MYSQL_USER + file_env POSTGRES_DB + file_env POSTGRES_PASSWORD + file_env POSTGRES_USER + + if [ -n "${SQLITE_DATABASE+x}" ]; then + echo "Installing with SQLite database" + # shellcheck disable=SC2016 + install_options=$install_options' --database-name "$SQLITE_DATABASE"' + install=true + elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then + echo "Installing with MySQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"' + install=true + elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then + echo "Installing with PostgreSQL database" + # shellcheck disable=SC2016 + install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"' + install=true + fi + + if [ "$install" = true ]; then + run_path pre-installation + + echo "Starting nextcloud installation" + max_retries=10 + try=0 + until [ "$try" -gt "$max_retries" ] || run_as "php /var/www/html/occ maintenance:install $install_options" + do + echo "Retrying install..." + try=$((try+1)) + sleep 10s + done + if [ "$try" -gt "$max_retries" ]; then + echo "Installing of nextcloud failed!" + exit 1 + fi + if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then + echo "Setting trusted domains…" + NC_TRUSTED_DOMAIN_IDX=1 + for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do + DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN" + NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1)) + done + fi + + run_path post-installation + fi + fi + # not enough specified to do a fully automated installation + if [ "$install" = false ]; then + echo "Next step: Access your instance to finish the web-based installation!" + echo "Hint: You can specify NEXTCLOUD_ADMIN_USER and NEXTCLOUD_ADMIN_PASSWORD and the database variables _prior to first launch_ to fully automate initial installation." + fi + # Upgrade + else + run_path pre-upgrade + + run_as 'php /var/www/html/occ upgrade' + + run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after + echo "The following apps have been disabled:" + diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + rm -f /tmp/list_before /tmp/list_after + + run_path post-upgrade + fi + + echo "Initializing finished" + fi + + # Update htaccess after init if requested + if [ -n "${NEXTCLOUD_INIT_HTACCESS+x}" ] && [ "$installed_version" != "0.0.0.0" ]; then + run_as 'php /var/www/html/occ maintenance:update:htaccess' + fi + ) 9> /var/www/html/nextcloud-init-sync.lock + + # warn if config files on persistent storage differ from the latest version of this image + for cfgPath in /usr/src/nextcloud/config/*.php; do + cfgFile=$(basename "$cfgPath") + + if [ "$cfgFile" != "config.sample.php" ] && [ "$cfgFile" != "autoconfig.php" ]; then + if ! cmp -s "/usr/src/nextcloud/config/$cfgFile" "/var/www/html/config/$cfgFile"; then + echo "Warning: /var/www/html/config/$cfgFile differs from the latest version of this image at /usr/src/nextcloud/config/$cfgFile" + fi + fi + done + + run_path before-starting +fi + +exec "$@" diff --git a/library/nextcloud/30/upgrade.exclude b/library/nextcloud/30/upgrade.exclude new file mode 100644 index 0000000..31ce39a --- /dev/null +++ b/library/nextcloud/30/upgrade.exclude @@ -0,0 +1,6 @@ +/config/ +/data/ +/custom_apps/ +/themes/ +/version.php +/nextcloud-init-sync.lock From e0d7cdfc98d95a8ef85eef2904d3abd6a725516b Mon Sep 17 00:00:00 2001 From: yzewei Date: Tue, 7 Jan 2025 14:38:23 +0800 Subject: [PATCH 13/13] add php 8.1-apache-sid Signed-off-by: yzewei --- library/php/8.1-apache-sid/Dockerfile | 297 ++++++++++++++++++ library/php/8.1-apache-sid/Makefile | 28 ++ library/php/8.1-apache-sid/apache2-foreground | 40 +++ .../php/8.1-apache-sid/docker-php-entrypoint | 9 + .../8.1-apache-sid/docker-php-ext-configure | 69 ++++ .../php/8.1-apache-sid/docker-php-ext-enable | 121 +++++++ .../php/8.1-apache-sid/docker-php-ext-install | 143 +++++++++ library/php/8.1-apache-sid/docker-php-source | 34 ++ 8 files changed, 741 insertions(+) create mode 100644 library/php/8.1-apache-sid/Dockerfile create mode 100644 library/php/8.1-apache-sid/Makefile create mode 100755 library/php/8.1-apache-sid/apache2-foreground create mode 100755 library/php/8.1-apache-sid/docker-php-entrypoint create mode 100755 library/php/8.1-apache-sid/docker-php-ext-configure create mode 100755 library/php/8.1-apache-sid/docker-php-ext-enable create mode 100755 library/php/8.1-apache-sid/docker-php-ext-install create mode 100755 library/php/8.1-apache-sid/docker-php-source diff --git a/library/php/8.1-apache-sid/Dockerfile b/library/php/8.1-apache-sid/Dockerfile new file mode 100644 index 0000000..0ce8712 --- /dev/null +++ b/library/php/8.1-apache-sid/Dockerfile @@ -0,0 +1,297 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +#FROM debian:bookworm-slim +FROM lcr.loongnix.cn/library/debian:sid + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends apache2; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ + \ +# setup directories and permissions + . "$APACHE_ENVVARS"; \ + for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ +# https://salsa.debian.org/apache-team/apache2/-/commit/b97ca8714890ead1ba6c095699dde752e8433205 + "$APACHE_RUN_DIR/socks" \ + ; do \ + rm -rvf "$dir"; \ + mkdir -p "$dir"; \ + chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + chmod 1777 "$dir"; \ + done; \ + \ +# delete the "index.html" that installing Apache drops in here + rm -rvf /var/www/html/*; \ + \ +# logs should go to stdout / stderr + ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ + ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ + chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" + +# Apache + PHP requires preforking Apache for best results +RUN a2dismod mpm_event && a2enmod mpm_prefork + +# PHP files should be handled by PHP, and should be preferred over any other file type +RUN { \ + echo ''; \ + echo '\tSetHandler application/x-httpd-php'; \ + echo ''; \ + echo; \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.php index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ + && a2enconf docker-php + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD + +ENV PHP_VERSION 8.1.31 +ENV PHP_URL="https://www.php.net/distributions/php-8.1.31.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.31.tar.xz.asc" +ENV PHP_SHA256="c4f244d46ba51c72f7d13d4f66ce6a9e9a8d6b669c51be35e01765ba58e7afca" + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + fi; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + apache2-dev \ + libargon2-dev \ + libcurl4-openssl-dev \ + libonig-dev \ + libreadline-dev \ + libsodium-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + zlib1g-dev \ + ; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ +# https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + ./configure \ + --build="$gnuArch" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# https://github.com/docker-library/php/issues/822 + --with-pic \ + \ +# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). + --enable-ftp \ +# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) + --enable-mbstring \ +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") + --disable-phpdbg \ + \ +# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") + --with-pear \ + \ +# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) +# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c +# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib + $(test "$gnuArch" = 'loongarch64-linux-gnu' && echo '--without-pcre-jit') \ + --with-libdir="lib/$debMultiarch" \ + \ + --disable-cgi \ + \ + --with-apxs2 \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies +# apt-mark auto '.*' > /dev/null; \ +# [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ +# find /usr/local -type f -executable -exec ldd '{}' ';' \ +# | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ +# | sort -u \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# ; \ +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ +# rm -rf /var/lib/apt/lists/*; \ + \ +# update pecl channel definitions https://github.com/docker-library/php/issues/443 + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop +STOPSIGNAL SIGWINCH + +COPY apache2-foreground /usr/local/bin/ +WORKDIR /var/www/html + +EXPOSE 80 +CMD ["apache2-foreground"] diff --git a/library/php/8.1-apache-sid/Makefile b/library/php/8.1-apache-sid/Makefile new file mode 100644 index 0000000..a5fc839 --- /dev/null +++ b/library/php/8.1-apache-sid/Makefile @@ -0,0 +1,28 @@ +# This file is generated by the template. + +REGISTRY ?=lcr.loongnix.cn +ORGANIZATION ?=library +REPOSITORY ?=php +TAG ?=8.1-apache-sid +LATEST ?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +image: + docker build \ + --build-arg http_proxy=$(http_proxy) \ + --build-arg https_proxy=$(https_proxy) \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi diff --git a/library/php/8.1-apache-sid/apache2-foreground b/library/php/8.1-apache-sid/apache2-foreground new file mode 100755 index 0000000..5fe22e2 --- /dev/null +++ b/library/php/8.1-apache-sid/apache2-foreground @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background. +# (also, when run as "apache2ctl ", it does not use "exec", which leaves an undesirable resident shell process) + +: "${APACHE_CONFDIR:=/etc/apache2}" +: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}" +if test -f "$APACHE_ENVVARS"; then + . "$APACHE_ENVVARS" +fi + +# Apache gets grumpy about PID files pre-existing +: "${APACHE_RUN_DIR:=/var/run/apache2}" +: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}" +rm -f "$APACHE_PID_FILE" + +# create missing directories +# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR) +for e in "${!APACHE_@}"; do + if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then + # handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir + # mkdir: cannot create directory '/var/lock': File exists + dir="${!e}" + while [ "$dir" != "$(dirname "$dir")" ]; do + dir="$(dirname "$dir")" + if [ -d "$dir" ]; then + break + fi + absDir="$(readlink -f "$dir" 2>/dev/null || :)" + if [ -n "$absDir" ]; then + mkdir -p "$absDir" + fi + done + + mkdir -p "${!e}" + fi +done + +exec apache2 -DFOREGROUND "$@" diff --git a/library/php/8.1-apache-sid/docker-php-entrypoint b/library/php/8.1-apache-sid/docker-php-entrypoint new file mode 100755 index 0000000..3d36d5e --- /dev/null +++ b/library/php/8.1-apache-sid/docker-php-entrypoint @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- apache2-foreground "$@" +fi + +exec "$@" diff --git a/library/php/8.1-apache-sid/docker-php-ext-configure b/library/php/8.1-apache-sid/docker-php-ext-configure new file mode 100755 index 0000000..34fc133 --- /dev/null +++ b/library/php/8.1-apache-sid/docker-php-ext-configure @@ -0,0 +1,69 @@ +#!/bin/sh +set -e + +# prefer user supplied CFLAGS, but default to our PHP_CFLAGS +: ${CFLAGS:=$PHP_CFLAGS} +: ${CPPFLAGS:=$PHP_CPPFLAGS} +: ${LDFLAGS:=$PHP_LDFLAGS} +export CFLAGS CPPFLAGS LDFLAGS + +srcExists= +if [ -d /usr/src/php ]; then + srcExists=1 +fi +docker-php-source extract +if [ -z "$srcExists" ]; then + touch /usr/src/php/.docker-delete-me +fi + +cd /usr/src/php/ext + +usage() { + echo "usage: $0 ext-name [configure flags]" + echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" + echo + echo 'Possible values for ext-name:' + find . \ + -mindepth 2 \ + -maxdepth 2 \ + -type f \ + -name 'config.m4' \ + | xargs -n1 dirname \ + | xargs -n1 basename \ + | sort \ + | xargs + echo + echo 'Some of the above modules are already compiled into PHP; please check' + echo 'the output of "php -i" to see which modules are already loaded.' +} + +ext="$1" +if [ -z "$ext" ] || [ ! -d "$ext" ]; then + usage >&2 + exit 1 +fi +shift + +pm='unknown' +if [ -e /lib/apk/db/installed ]; then + pm='apk' +fi + +if [ "$pm" = 'apk' ]; then + if \ + [ -n "$PHPIZE_DEPS" ] \ + && ! apk info --installed .phpize-deps > /dev/null \ + && ! apk info --installed .phpize-deps-configure > /dev/null \ + ; then + apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS + fi +fi + +if command -v dpkg-architecture > /dev/null; then + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" + set -- --build="$gnuArch" "$@" +fi + +cd "$ext" +phpize +./configure --enable-option-checking=fatal "$@" diff --git a/library/php/8.1-apache-sid/docker-php-ext-enable b/library/php/8.1-apache-sid/docker-php-ext-enable new file mode 100755 index 0000000..41d20bb --- /dev/null +++ b/library/php/8.1-apache-sid/docker-php-ext-enable @@ -0,0 +1,121 @@ +#!/bin/sh +set -e + +extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" +cd "$extDir" + +usage() { + echo "usage: $0 [options] module-name [module-name ...]" + echo " ie: $0 gd mysqli" + echo " $0 pdo pdo_mysql" + echo " $0 --ini-name 0-apc.ini apcu apc" + echo + echo 'Possible values for module-name:' + find -maxdepth 1 \ + -type f \ + -name '*.so' \ + -exec basename '{}' ';' \ + | sort \ + | xargs + echo + echo 'Some of the above modules are already compiled into PHP; please check' + echo 'the output of "php -i" to see which modules are already loaded.' +} + +opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" +eval set -- "$opts" + +iniName= +while true; do + flag="$1" + shift + case "$flag" in + --help|-h|'-?') usage && exit 0 ;; + --ini-name) iniName="$1" && shift ;; + --) break ;; + *) + { + echo "error: unknown flag: $flag" + usage + } >&2 + exit 1 + ;; + esac +done + +modules= +for module; do + if [ -z "$module" ]; then + continue + fi + if ! [ -f "$module" ] && ! [ -f "$module.so" ]; then + echo >&2 "error: '$module' does not exist" + echo >&2 + usage >&2 + exit 1 + fi + modules="$modules $module" +done + +if [ -z "$modules" ]; then + usage >&2 + exit 1 +fi + +pm='unknown' +if [ -e /lib/apk/db/installed ]; then + pm='apk' +fi + +apkDel= +if [ "$pm" = 'apk' ]; then + if \ + [ -n "$PHPIZE_DEPS" ] \ + && ! apk info --installed .phpize-deps > /dev/null \ + && ! apk info --installed .phpize-deps-configure > /dev/null \ + ; then + apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils + apkDel='.docker-php-ext-enable-deps' + fi +fi + +for module in $modules; do + moduleFile="$module" + if [ -f "$module.so" ] && ! [ -f "$module" ]; then + moduleFile="$module.so" + fi + if readelf --wide --syms "$moduleFile" | grep -q ' zend_extension_entry$'; then + # https://wiki.php.net/internals/extensions#loading_zend_extensions + line="zend_extension=$module" + else + line="extension=$module" + fi + + ext="$(basename "$module")" + ext="${ext%.*}" + if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then + # this isn't perfect, but it's better than nothing + # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') + echo >&2 + echo >&2 "warning: $ext ($module) is already loaded!" + echo >&2 + continue + fi + + case "$iniName" in + /*) + # allow an absolute path + ini="$iniName" + ;; + *) + ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" + ;; + esac + if ! grep -qFx -e "$line" -e "$line.so" "$ini" 2>/dev/null; then + echo "$line" >> "$ini" + fi +done + +if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then + apk del --no-network $apkDel +fi diff --git a/library/php/8.1-apache-sid/docker-php-ext-install b/library/php/8.1-apache-sid/docker-php-ext-install new file mode 100755 index 0000000..aa0b96c --- /dev/null +++ b/library/php/8.1-apache-sid/docker-php-ext-install @@ -0,0 +1,143 @@ +#!/bin/sh +set -e + +# prefer user supplied CFLAGS, but default to our PHP_CFLAGS +: ${CFLAGS:=$PHP_CFLAGS} +: ${CPPFLAGS:=$PHP_CPPFLAGS} +: ${LDFLAGS:=$PHP_LDFLAGS} +export CFLAGS CPPFLAGS LDFLAGS + +srcExists= +if [ -d /usr/src/php ]; then + srcExists=1 +fi +docker-php-source extract +if [ -z "$srcExists" ]; then + touch /usr/src/php/.docker-delete-me +fi + +cd /usr/src/php/ext + +usage() { + echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]" + echo " ie: $0 gd mysqli" + echo " $0 pdo pdo_mysql" + echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" + echo + echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' + echo + echo 'Possible values for ext-name:' + find . \ + -mindepth 2 \ + -maxdepth 2 \ + -type f \ + -name 'config.m4' \ + | xargs -n1 dirname \ + | xargs -n1 basename \ + | sort \ + | xargs + echo + echo 'Some of the above modules are already compiled into PHP; please check' + echo 'the output of "php -i" to see which modules are already loaded.' +} + +opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })" +eval set -- "$opts" + +j=1 +iniName= +while true; do + flag="$1" + shift + case "$flag" in + --help|-h|'-?') usage && exit 0 ;; + --ini-name) iniName="$1" && shift ;; + --jobs|-j) j="$1" && shift ;; + --) break ;; + *) + { + echo "error: unknown flag: $flag" + usage + } >&2 + exit 1 + ;; + esac +done + +exts= +for ext; do + if [ -z "$ext" ]; then + continue + fi + if [ ! -d "$ext" ]; then + echo >&2 "error: $PWD/$ext does not exist" + echo >&2 + usage >&2 + exit 1 + fi + exts="$exts $ext" +done + +if [ -z "$exts" ]; then + usage >&2 + exit 1 +fi + +pm='unknown' +if [ -e /lib/apk/db/installed ]; then + pm='apk' +fi + +apkDel= +if [ "$pm" = 'apk' ]; then + if [ -n "$PHPIZE_DEPS" ]; then + if apk info --installed .phpize-deps-configure > /dev/null; then + apkDel='.phpize-deps-configure' + elif ! apk info --installed .phpize-deps > /dev/null; then + apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS + apkDel='.phpize-deps' + fi + fi +fi + +popDir="$PWD" +for ext in $exts; do + cd "$ext" + + [ -e Makefile ] || docker-php-ext-configure "$ext" + + make -j"$j" + + if ! php -n -d 'display_errors=stderr' -r 'exit(ZEND_DEBUG_BUILD ? 0 : 1);' > /dev/null; then + # only "strip" modules if we aren't using a debug build of PHP + # (none of our builds are debug builds, but PHP might be recompiled with "--enable-debug" configure option) + # https://github.com/docker-library/php/issues/1268 + + find modules \ + -maxdepth 1 \ + -name '*.so' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : + ' -- '{}' + + fi + + make -j"$j" install + + find modules \ + -maxdepth 1 \ + -name '*.so' \ + -exec basename '{}' ';' \ + | xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"} + + make -j"$j" clean + + cd "$popDir" +done + +if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then + apk del --no-network $apkDel +fi + +if [ -e /usr/src/php/.docker-delete-me ]; then + docker-php-source delete +fi diff --git a/library/php/8.1-apache-sid/docker-php-source b/library/php/8.1-apache-sid/docker-php-source new file mode 100755 index 0000000..9033d24 --- /dev/null +++ b/library/php/8.1-apache-sid/docker-php-source @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +dir=/usr/src/php + +usage() { + echo "usage: $0 COMMAND" + echo + echo "Manage php source tarball lifecycle." + echo + echo "Commands:" + echo " extract extract php source tarball into directory $dir if not already done." + echo " delete delete extracted php source located into $dir if not already done." + echo +} + +case "$1" in + extract) + mkdir -p "$dir" + if [ ! -f "$dir/.docker-extracted" ]; then + tar -Jxf /usr/src/php.tar.xz -C "$dir" --strip-components=1 + touch "$dir/.docker-extracted" + fi + ;; + + delete) + rm -rf "$dir" + ;; + + *) + usage + exit 1 + ;; +esac