Skip to content

Commit fec469d

Browse files
committed
Docker: added a target to generate Docker library definition.
1 parent 02b00f9 commit fec469d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pkg/docker/Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,27 @@ build-%: Dockerfile.%
9292
docker pull $(CONTAINER_$(call modname, $*))
9393
docker build --no-cache -t unit:$(VERSION)-$* -f Dockerfile.$* .
9494

95+
library:
96+
@echo "# this file is generated via https://github.com/nginx/unit/$(shell git describe --always --abbrev=0 HEAD)/pkg/docker/Makefile"
97+
@echo ""
98+
@echo "Maintainers: Unit Docker Maintainers <[email protected]> (@nginx)"
99+
@echo "GitRepo: https://github.com/nginx/unit.git"
100+
@for mod in $(MODVERSIONS); do \
101+
echo ""; \
102+
TAGS="$$mod $${mod%%.*} $$( echo $$mod | tr -d '.0123456789-' )"; \
103+
TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \
104+
echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \
105+
echo "Architectures: amd64, arm64v8"; \
106+
echo "GitFetch: refs/heads/packaging"; \
107+
echo "GitCommit: $(shell git describe --always --abbrev=0 HEAD)"; \
108+
echo "Directory: pkg/docker"; \
109+
echo "File: Dockerfile.$$mod"; \
110+
done
111+
95112
all: $(addprefix Dockerfile., $(MODVERSIONS))
96113

97114
clean:
98115
rm -f $(addprefix Dockerfile., $(MODVERSIONS))
99116
rm -rf $(EXPORT_DIR)
100117

101-
.PHONY: default build dockerfiles clean
118+
.PHONY: default build dockerfiles clean library

0 commit comments

Comments
 (0)