summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-08-19 17:15:54 -0700
committerKonstantin Pavlov <pavlov.konstantin@gmail.com>2024-08-26 16:42:47 -0700
commit8eb5d128a3a28f4363c22170fca6fce8c3b9b166 (patch)
tree103424720841b6e294f7b9d107112ebb548760b4
parent5b47542e345bb68b0f7d1cbfda0d22065b4273ce (diff)
downloadunit-8eb5d128a3a28f4363c22170fca6fce8c3b9b166.tar.gz
unit-8eb5d128a3a28f4363c22170fca6fce8c3b9b166.tar.bz2
Docker: introduce "slim" python images
Closes: https://github.com/nginx/unit/issues/1352
-rw-r--r--pkg/docker/Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile
index e0e0f523..6657c24c 100644
--- a/pkg/docker/Makefile
+++ b/pkg/docker/Makefile
@@ -9,6 +9,7 @@ VERSION ?= $(DEFAULT_VERSION)
PATCHLEVEL ?= 1
MODULES ?= go jsc node perl php python ruby wasm
+MODULES_SLIM ?= python
VARIANT ?= bookworm
@@ -62,6 +63,7 @@ MODULE_PREBUILD_php ?= /bin/true
VERSIONS_python ?= 3.11 3.12
VARIANT_python ?= $(VARIANT)
$(foreach pythonversion, $(VERSIONS_python), $(eval CONTAINER_python$(pythonversion) = python:$(pythonversion)-$(VARIANT_python)))
+$(foreach pythonversion, $(VERSIONS_python), $(eval CONTAINER_python$(pythonversion)-slim = python:$(pythonversion)-slim-$(VARIANT_python)))
CONFIGURE_python ?= python --config=/usr/local/bin/python3-config
INSTALL_python ?= python3-install
RUN_python ?= /bin/true
@@ -109,9 +111,11 @@ endef
default:
@echo "valid targets: all build dockerfiles library clean"
-MODVERSIONS = $(foreach module, $(MODULES), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion))) wasm minimal
+MODVERSIONS = $(foreach module, $(MODULES), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion)))
+MODVERSIONS += $(foreach module, $(MODULES_SLIM), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion)-slim))
+MODVERSIONS += wasm minimal
-modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-')
+modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-' | sed 's/slim//')
dockerfiles: $(addprefix Dockerfile., $(MODVERSIONS))
build: $(addprefix build-, $(MODVERSIONS))
@@ -141,10 +145,14 @@ library:
@previous=""; \
for mod in $(MODVERSIONS); do \
echo ""; \
- modname="$$( echo $$mod | tr -d '.0123456789-' )"; \
- TAGS="$$mod $${mod%%.*} $$modname" ; \
+ modname="$$( echo $$mod | tr -d '.0123456789')"; \
+ modmajor="$${mod%%.*}"; \
+ if test "$${mod#*slim}" != "$$mod"; then \
+ modmajor="$${modmajor}-slim"; \
+ fi; \
+ TAGS="$$mod $$modmajor $$modname"; \
TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \
- if [ "$$previous" = "$$modname" ]; then \
+ if test "$${previous#*"$$modname"}" != "$$previous"; then \
echo "Tags: $(VERSION)-$$mod, $$mod"; \
else \
if [ "$$mod" = "minimal" ]; then \
@@ -158,7 +166,7 @@ library:
echo "GitCommit: $(shell git describe --always --abbrev=0 HEAD)"; \
echo "Directory: pkg/docker"; \
echo "File: Dockerfile.$$mod"; \
- previous=$$(echo $$mod | tr -d '.0123456789-'); \
+ previous="$$previous $$modname"; \
done
diff: $(addprefix diff-, $(MODVERSIONS))