From a8f21079e056931b5aedb10037d03315d62bb41b Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 13 Feb 2023 17:04:24 -0800 Subject: Docker: cleanup unused targets. --- pkg/docker/Makefile | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index b08e885f..ac292b56 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -69,7 +69,7 @@ INSTALL_ruby ?= ruby-install COPY_ruby = RUN gem install rack default: - @echo "valid targets: all build dockerfiles push tag export clean" + @echo "valid targets: all build dockerfiles clean" MODVERSIONS = $(foreach module,$(MODULES),$(module)$(VERSION_$(module))) @@ -77,9 +77,6 @@ modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-') dockerfiles: $(addprefix Dockerfile., $(MODVERSIONS)) build: $(addprefix build-,$(MODVERSIONS)) -tag: $(addprefix tag-,$(MODVERSIONS)) -push: $(addprefix push-,$(MODVERSIONS)) -export: $(addsuffix .tar.gz,$(addprefix $(EXPORT_DIR)/nginx-unit-$(VERSION)-,$(MODVERSIONS))) $(addsuffix .tar.gz.sha512, $(addprefix $(EXPORT_DIR)/nginx-unit-$(VERSION)-,$(MODVERSIONS))) Dockerfile.%: ../../version @echo "===> Building $@" @@ -95,25 +92,10 @@ build-%: Dockerfile.% docker pull $(CONTAINER_$(call modname, $*)) docker build --no-cache -t unit:$(VERSION)-$* -f Dockerfile.$* . -tag-%: build-% - docker tag unit:$(VERSION)-$* nginx/unit:$(VERSION)-$* - -push-%: tag-% - docker push nginx/unit:$(VERSION)-$* - -$(EXPORT_DIR): - mkdir -p $@ - -$(EXPORT_DIR)/nginx-unit-$(VERSION)-%.tar.gz: $(EXPORT_DIR) tag-% - docker save nginx/unit:$(VERSION)-$* | gzip > $@ - -$(EXPORT_DIR)/nginx-unit-$(VERSION)-%.tar.gz.sha512: $(EXPORT_DIR)/nginx-unit-$(VERSION)-%.tar.gz - $(SHA512SUM) $< | sed 's,$(EXPORT_DIR)/,,' > $@ - all: $(addprefix Dockerfile., $(MODVERSIONS)) clean: rm -f $(addprefix Dockerfile., $(MODVERSIONS)) rm -rf $(EXPORT_DIR) -.PHONY: default build dockerfiles push tag export clean +.PHONY: default build dockerfiles clean -- cgit From eb47174875b9add0a2171c2f1a00ecb8435f496f Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 13 Feb 2023 17:04:24 -0800 Subject: Docker: added a target to generate Docker library definition. --- pkg/docker/Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index ac292b56..469fca96 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -92,10 +92,27 @@ build-%: Dockerfile.% docker pull $(CONTAINER_$(call modname, $*)) docker build --no-cache -t unit:$(VERSION)-$* -f Dockerfile.$* . +library: + @echo "# this file is generated via https://github.com/nginx/unit/$(shell git describe --always --abbrev=0 HEAD)/pkg/docker/Makefile" + @echo "" + @echo "Maintainers: Unit Docker Maintainers (@nginx)" + @echo "GitRepo: https://github.com/nginx/unit.git" + @for mod in $(MODVERSIONS); do \ + echo ""; \ + TAGS="$$mod $${mod%%.*} $$( echo $$mod | tr -d '.0123456789-' )"; \ + TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \ + echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ + echo "Architectures: amd64, arm64v8"; \ + echo "GitFetch: refs/heads/packaging"; \ + echo "GitCommit: $(shell git describe --always --abbrev=0 HEAD)"; \ + echo "Directory: pkg/docker"; \ + echo "File: Dockerfile.$$mod"; \ + done + all: $(addprefix Dockerfile., $(MODVERSIONS)) clean: rm -f $(addprefix Dockerfile., $(MODVERSIONS)) rm -rf $(EXPORT_DIR) -.PHONY: default build dockerfiles clean +.PHONY: default build dockerfiles clean library -- cgit From 054518bb360e4be6d4892025c02c811872d93e99 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 13 Feb 2023 17:04:24 -0800 Subject: Docker: made dockerfiles use a single stage build process. --- pkg/docker/Makefile | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index 469fca96..e0644166 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -15,58 +15,49 @@ VERSION_minimal ?= CONTAINER_minimal ?= debian:bullseye-slim CONFIGURE_minimal ?= INSTALL_minimal ?= version -define COPY_minimal -endef +RUN_minimal ?= /bin/true VERSION_go ?= 1.19 CONTAINER_go ?= golang:$(VERSION_go) CONFIGURE_go ?= go --go-path=$$GOPATH INSTALL_go ?= go-install-src libunit-install -define COPY_go -COPY --from=BUILDER /usr/lib/\*-linux-gnu/libunit.a /tmp/\n\$ -COPY --from=BUILDER /usr/include/nxt_* /usr/include/\n\$ -COPY --from=BUILDER /go/src/ /go/src/ -endef +RUN_go ?= /bin/true VERSION_jsc ?= 11 CONTAINER_jsc ?= eclipse-temurin:$(VERSION_jsc)-jdk CONFIGURE_jsc ?= java --jars=/usr/share/unit-jsc-common/ INSTALL_jsc ?= java-shared-install java-install -COPY_jsc = COPY --from=BUILDER /usr/share/unit-jsc-common/ /usr/share/unit-jsc-common/ +RUN_jsc ?= /bin/true VERSION_node ?= 18 CONTAINER_node ?= node:$(VERSION_node) CONFIGURE_node ?= nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp INSTALL_node ?= node node-install libunit-install -define COPY_node -COPY --from=BUILDER /usr/lib/\*-linux-gnu/libunit.a /tmp/\n\$ -COPY --from=BUILDER /usr/include/nxt_* /usr/include/\n\$ -COPY --from=BUILDER /usr/local/lib/node_modules/unit-http/ /usr/local/lib/node_modules/unit-http/ -endef +RUN_node ?= /bin/true VERSION_perl ?= 5.36 CONTAINER_perl ?= perl:$(VERSION_perl) CONFIGURE_perl ?= perl INSTALL_perl ?= perl-install -COPY_perl = +RUN_perl ?= /bin/true VERSION_php ?= 8.1 CONTAINER_php ?= php:$(VERSION_php)-cli CONFIGURE_php ?= php INSTALL_php ?= php-install -COPY_php = RUN ldconfig +RUN_php ?= ldconfig VERSION_python ?= 3.11 CONTAINER_python ?= python:$(VERSION_python) CONFIGURE_python ?= python --config=/usr/local/bin/python3-config INSTALL_python ?= python3-install -COPY_python = +RUN_python ?= /bin/true VERSION_ruby ?= 3.1 CONTAINER_ruby ?= ruby:$(VERSION_ruby) CONFIGURE_ruby ?= ruby INSTALL_ruby ?= ruby-install -COPY_ruby = RUN gem install rack +RUN_ruby ?= gem install rack default: @echo "valid targets: all build dockerfiles clean" @@ -78,14 +69,14 @@ modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-') dockerfiles: $(addprefix Dockerfile., $(MODVERSIONS)) build: $(addprefix build-,$(MODVERSIONS)) -Dockerfile.%: ../../version +Dockerfile.%: ../../version template.Dockerfile @echo "===> Building $@" cat template.Dockerfile | sed \ -e 's,@@VERSION@@,$(VERSION),g' \ -e 's,@@CONTAINER@@,$(CONTAINER_$(call modname, $*)),g' \ -e 's,@@CONFIGURE@@,$(CONFIGURE_$(call modname, $*)),g' \ -e 's,@@INSTALL@@,$(INSTALL_$(call modname, $*)),g' \ - -e 's,@@COPY@@,$(COPY_$(call modname, $*)),g' \ + -e 's,@@RUN@@,$(RUN_$(call modname, $*)),g' \ > $@ build-%: Dockerfile.% -- cgit From 565dcbb13987d32436993827b1eac0c4eceb42fa Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 13 Feb 2023 17:04:24 -0800 Subject: Docker: bumped language versions. --- pkg/docker/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index e0644166..46b75f27 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -17,7 +17,7 @@ CONFIGURE_minimal ?= INSTALL_minimal ?= version RUN_minimal ?= /bin/true -VERSION_go ?= 1.19 +VERSION_go ?= 1.20 CONTAINER_go ?= golang:$(VERSION_go) CONFIGURE_go ?= go --go-path=$$GOPATH INSTALL_go ?= go-install-src libunit-install @@ -41,7 +41,7 @@ CONFIGURE_perl ?= perl INSTALL_perl ?= perl-install RUN_perl ?= /bin/true -VERSION_php ?= 8.1 +VERSION_php ?= 8.2 CONTAINER_php ?= php:$(VERSION_php)-cli CONFIGURE_php ?= php INSTALL_php ?= php-install @@ -53,7 +53,7 @@ CONFIGURE_python ?= python --config=/usr/local/bin/python3-config INSTALL_python ?= python3-install RUN_python ?= /bin/true -VERSION_ruby ?= 3.1 +VERSION_ruby ?= 3.2 CONTAINER_ruby ?= ruby:$(VERSION_ruby) CONFIGURE_ruby ?= ruby INSTALL_ruby ?= ruby-install -- cgit From 8392f8c90220fdacef70ed38bdf29e4a89ed6601 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 10 Apr 2023 15:36:48 -0700 Subject: Docker: check out packaging tags. This will ensure we're checking out source code that is close to what we have in binary packages. While at it, remove the checkout directory when it's no longer needed. --- pkg/docker/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index 46b75f27..b0a6857c 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -6,6 +6,7 @@ include ../shasum.mak DEFAULT_VERSION := $(NXT_VERSION) VERSION ?= $(DEFAULT_VERSION) +PATCHLEVEL ?= 1 EXPORT_DIR := $(VERSION) @@ -73,6 +74,7 @@ Dockerfile.%: ../../version template.Dockerfile @echo "===> Building $@" cat template.Dockerfile | sed \ -e 's,@@VERSION@@,$(VERSION),g' \ + -e 's,@@PATCHLEVEL@@,$(PATCHLEVEL),g' \ -e 's,@@CONTAINER@@,$(CONTAINER_$(call modname, $*)),g' \ -e 's,@@CONFIGURE@@,$(CONFIGURE_$(call modname, $*)),g' \ -e 's,@@INSTALL@@,$(INSTALL_$(call modname, $*)),g' \ -- cgit From 09cd3793aa7dc567384a58cd77aa5b65943722a7 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 6 Apr 2023 20:43:22 -0700 Subject: Docker: specified explicit variants of images to use. This allows us to decide when to move to a newer underlying distribution version with our pace instead of relying on Docker Hub cadence. --- pkg/docker/Makefile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index b0a6857c..6c5006bf 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -12,50 +12,59 @@ EXPORT_DIR := $(VERSION) MODULES ?= go jsc node perl php python ruby minimal +VARIANT ?= bullseye + VERSION_minimal ?= -CONTAINER_minimal ?= debian:bullseye-slim +CONTAINER_minimal ?= debian:$(VARIANT)-slim CONFIGURE_minimal ?= INSTALL_minimal ?= version RUN_minimal ?= /bin/true VERSION_go ?= 1.20 -CONTAINER_go ?= golang:$(VERSION_go) +VARIANT_go ?= $(VARIANT) +CONTAINER_go ?= golang:$(VERSION_go)-$(VARIANT_go) CONFIGURE_go ?= go --go-path=$$GOPATH INSTALL_go ?= go-install-src libunit-install RUN_go ?= /bin/true VERSION_jsc ?= 11 -CONTAINER_jsc ?= eclipse-temurin:$(VERSION_jsc)-jdk +VARIANT_jsc ?= jammy +CONTAINER_jsc ?= eclipse-temurin:$(VERSION_jsc)-jdk-$(VARIANT_jsc) CONFIGURE_jsc ?= java --jars=/usr/share/unit-jsc-common/ INSTALL_jsc ?= java-shared-install java-install RUN_jsc ?= /bin/true VERSION_node ?= 18 -CONTAINER_node ?= node:$(VERSION_node) +VARIANT_node ?= $(VARIANT) +CONTAINER_node ?= node:$(VERSION_node)-$(VARIANT_node) CONFIGURE_node ?= nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp INSTALL_node ?= node node-install libunit-install RUN_node ?= /bin/true VERSION_perl ?= 5.36 -CONTAINER_perl ?= perl:$(VERSION_perl) +VARIANT_perl ?= $(VARIANT) +CONTAINER_perl ?= perl:$(VERSION_perl)-$(VARIANT_perl) CONFIGURE_perl ?= perl INSTALL_perl ?= perl-install RUN_perl ?= /bin/true VERSION_php ?= 8.2 -CONTAINER_php ?= php:$(VERSION_php)-cli +VARIANT_php ?= cli-$(VARIANT) +CONTAINER_php ?= php:$(VERSION_php)-$(VARIANT_php) CONFIGURE_php ?= php INSTALL_php ?= php-install RUN_php ?= ldconfig VERSION_python ?= 3.11 -CONTAINER_python ?= python:$(VERSION_python) +VARIANT_python ?= $(VARIANT) +CONTAINER_python ?= python:$(VERSION_python)-$(VARIANT_python) CONFIGURE_python ?= python --config=/usr/local/bin/python3-config INSTALL_python ?= python3-install RUN_python ?= /bin/true VERSION_ruby ?= 3.2 -CONTAINER_ruby ?= ruby:$(VERSION_ruby) +VARIANT_ruby ?= $(VARIANT) +CONTAINER_ruby ?= ruby:$(VERSION_ruby)-$(VARIANT_ruby) CONFIGURE_ruby ?= ruby INSTALL_ruby ?= ruby-install RUN_ruby ?= gem install rack -- cgit From 028e537bef2d007ed8b1a02857cc8e569caeea57 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 28 Mar 2023 14:45:10 -0700 Subject: Docker: fixed git references. --- pkg/docker/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index 6c5006bf..5b1f4f20 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -95,7 +95,7 @@ build-%: Dockerfile.% docker build --no-cache -t unit:$(VERSION)-$* -f Dockerfile.$* . library: - @echo "# this file is generated via https://github.com/nginx/unit/$(shell git describe --always --abbrev=0 HEAD)/pkg/docker/Makefile" + @echo "# this file is generated via https://github.com/nginx/unit/blob/$(shell git describe --always --abbrev=0 HEAD)/pkg/docker/Makefile" @echo "" @echo "Maintainers: Unit Docker Maintainers (@nginx)" @echo "GitRepo: https://github.com/nginx/unit.git" @@ -105,7 +105,7 @@ library: TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \ echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ echo "Architectures: amd64, arm64v8"; \ - echo "GitFetch: refs/heads/packaging"; \ + echo "GitFetch: refs/heads/branches/packaging"; \ echo "GitCommit: $(shell git describe --always --abbrev=0 HEAD)"; \ echo "Directory: pkg/docker"; \ echo "File: Dockerfile.$$mod"; \ -- cgit From 6e548cbb30c0035b0d377dced7564522fba4eff3 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 5 May 2023 17:19:55 -0700 Subject: Docker: added a way to generate multiple versions of an image. --- pkg/docker/Makefile | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index 5b1f4f20..41c22171 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -10,61 +10,61 @@ PATCHLEVEL ?= 1 EXPORT_DIR := $(VERSION) -MODULES ?= go jsc node perl php python ruby minimal +MODULES ?= go jsc node perl php python ruby VARIANT ?= bullseye -VERSION_minimal ?= +VERSIONS_minimal ?= CONTAINER_minimal ?= debian:$(VARIANT)-slim CONFIGURE_minimal ?= INSTALL_minimal ?= version RUN_minimal ?= /bin/true -VERSION_go ?= 1.20 +VERSIONS_go ?= 1.20 VARIANT_go ?= $(VARIANT) -CONTAINER_go ?= golang:$(VERSION_go)-$(VARIANT_go) +$(foreach goversion, $(VERSIONS_go), $(eval CONTAINER_go$(goversion) = golang:$(goversion)-$(VARIANT_go))) CONFIGURE_go ?= go --go-path=$$GOPATH INSTALL_go ?= go-install-src libunit-install RUN_go ?= /bin/true -VERSION_jsc ?= 11 +VERSIONS_jsc ?= 11 VARIANT_jsc ?= jammy -CONTAINER_jsc ?= eclipse-temurin:$(VERSION_jsc)-jdk-$(VARIANT_jsc) +$(foreach jscversion, $(VERSIONS_jsc), $(eval CONTAINER_jsc$(jscversion) = eclipse-temurin:$(jscversion)-jdk-$(VARIANT_jsc))) CONFIGURE_jsc ?= java --jars=/usr/share/unit-jsc-common/ INSTALL_jsc ?= java-shared-install java-install RUN_jsc ?= /bin/true -VERSION_node ?= 18 +VERSIONS_node ?= 18 VARIANT_node ?= $(VARIANT) -CONTAINER_node ?= node:$(VERSION_node)-$(VARIANT_node) +$(foreach nodeversion, $(VERSIONS_node), $(eval CONTAINER_node$(nodeversion) = node:$(nodeversion)-$(VARIANT_node))) CONFIGURE_node ?= nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp INSTALL_node ?= node node-install libunit-install RUN_node ?= /bin/true -VERSION_perl ?= 5.36 +VERSIONS_perl ?= 5.36 VARIANT_perl ?= $(VARIANT) -CONTAINER_perl ?= perl:$(VERSION_perl)-$(VARIANT_perl) +$(foreach perlversion, $(VERSIONS_perl), $(eval CONTAINER_perl$(perlversion) = perl:$(perlversion)-$(VARIANT_perl))) CONFIGURE_perl ?= perl INSTALL_perl ?= perl-install RUN_perl ?= /bin/true -VERSION_php ?= 8.2 +VERSIONS_php ?= 8.2 VARIANT_php ?= cli-$(VARIANT) -CONTAINER_php ?= php:$(VERSION_php)-$(VARIANT_php) +$(foreach phpversion, $(VERSIONS_php), $(eval CONTAINER_php$(phpversion) = php:$(phpversion)-$(VARIANT_php))) CONFIGURE_php ?= php INSTALL_php ?= php-install RUN_php ?= ldconfig -VERSION_python ?= 3.11 +VERSIONS_python ?= 3.11 VARIANT_python ?= $(VARIANT) -CONTAINER_python ?= python:$(VERSION_python)-$(VARIANT_python) +$(foreach pythonversion, $(VERSIONS_python), $(eval CONTAINER_python$(pythonversion) = python:$(pythonversion)-$(VARIANT_python))) CONFIGURE_python ?= python --config=/usr/local/bin/python3-config INSTALL_python ?= python3-install RUN_python ?= /bin/true -VERSION_ruby ?= 3.2 +VERSIONS_ruby ?= 3.2 VARIANT_ruby ?= $(VARIANT) -CONTAINER_ruby ?= ruby:$(VERSION_ruby)-$(VARIANT_ruby) +$(foreach rubyversion, $(VERSIONS_ruby), $(eval CONTAINER_ruby$(rubyversion) = ruby:$(rubyversion)-$(VARIANT_ruby))) CONFIGURE_ruby ?= ruby INSTALL_ruby ?= ruby-install RUN_ruby ?= gem install rack @@ -72,26 +72,26 @@ RUN_ruby ?= gem install rack default: @echo "valid targets: all build dockerfiles clean" -MODVERSIONS = $(foreach module,$(MODULES),$(module)$(VERSION_$(module))) +MODVERSIONS = $(foreach module, $(MODULES), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion))) minimal modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-') dockerfiles: $(addprefix Dockerfile., $(MODVERSIONS)) -build: $(addprefix build-,$(MODVERSIONS)) +build: $(addprefix build-, $(MODVERSIONS)) Dockerfile.%: ../../version template.Dockerfile @echo "===> Building $@" cat template.Dockerfile | sed \ -e 's,@@VERSION@@,$(VERSION),g' \ -e 's,@@PATCHLEVEL@@,$(PATCHLEVEL),g' \ - -e 's,@@CONTAINER@@,$(CONTAINER_$(call modname, $*)),g' \ + -e 's,@@CONTAINER@@,$(CONTAINER_$*),g' \ -e 's,@@CONFIGURE@@,$(CONFIGURE_$(call modname, $*)),g' \ -e 's,@@INSTALL@@,$(INSTALL_$(call modname, $*)),g' \ -e 's,@@RUN@@,$(RUN_$(call modname, $*)),g' \ > $@ build-%: Dockerfile.% - docker pull $(CONTAINER_$(call modname, $*)) + docker pull $(CONTAINER_$*) docker build --no-cache -t unit:$(VERSION)-$* -f Dockerfile.$* . library: @@ -99,16 +99,23 @@ library: @echo "" @echo "Maintainers: Unit Docker Maintainers (@nginx)" @echo "GitRepo: https://github.com/nginx/unit.git" - @for mod in $(MODVERSIONS); do \ + @previous=""; \ + for mod in $(MODVERSIONS); do \ echo ""; \ - TAGS="$$mod $${mod%%.*} $$( echo $$mod | tr -d '.0123456789-' )"; \ + modname="$$( echo $$mod | tr -d '.0123456789-' )"; \ + TAGS="$$mod $${mod%%.*} $$modname" ; \ TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \ - echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ + if [ "$$previous" == "$$modname" ]; then \ + echo "Tags: $(VERSION)-$$mod, $$mod"; \ + else \ + echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ + fi; \ echo "Architectures: amd64, arm64v8"; \ echo "GitFetch: refs/heads/branches/packaging"; \ echo "GitCommit: $(shell git describe --always --abbrev=0 HEAD)"; \ echo "Directory: pkg/docker"; \ echo "File: Dockerfile.$$mod"; \ + previous=$$(echo $$mod | tr -d '.0123456789-'); \ done all: $(addprefix Dockerfile., $(MODVERSIONS)) -- cgit From 5b98d87e523bd5180f0b3caf655c779ed83f686a Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 5 May 2023 17:20:06 -0700 Subject: Docker: Makefile housekeeping. --- pkg/docker/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index 41c22171..bf5fe061 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -8,8 +8,6 @@ DEFAULT_VERSION := $(NXT_VERSION) VERSION ?= $(DEFAULT_VERSION) PATCHLEVEL ?= 1 -EXPORT_DIR := $(VERSION) - MODULES ?= go jsc node perl php python ruby VARIANT ?= bullseye @@ -70,7 +68,7 @@ INSTALL_ruby ?= ruby-install RUN_ruby ?= gem install rack default: - @echo "valid targets: all build dockerfiles clean" + @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))) minimal @@ -121,7 +119,6 @@ library: all: $(addprefix Dockerfile., $(MODVERSIONS)) clean: - rm -f $(addprefix Dockerfile., $(MODVERSIONS)) - rm -rf $(EXPORT_DIR) + rm -f Dockerfile.* .PHONY: default build dockerfiles clean library -- cgit From 8ab16f71fee9505d4159154179082c0aec03ca4c Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 5 May 2023 17:20:10 -0700 Subject: Docker: tagged minimal variant as latest. --- pkg/docker/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/docker/Makefile') diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index bf5fe061..cb801253 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -106,7 +106,11 @@ library: if [ "$$previous" == "$$modname" ]; then \ echo "Tags: $(VERSION)-$$mod, $$mod"; \ else \ - echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ + if [ "$$mod" == "minimal" ]; then \ + echo "Tags: $(VERSION)-$$mod, $${TAGS%, }, latest"; \ + else \ + echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \ + fi; \ fi; \ echo "Architectures: amd64, arm64v8"; \ echo "GitFetch: refs/heads/branches/packaging"; \ -- cgit