Add Docker manifest with multiple architectures
This commit is contained in:
committed by
fguillot
parent
6957edc8b0
commit
96dd20c0cd
46
Makefile
46
Makefile
@@ -1,46 +1,40 @@
|
||||
DOCKER_IMAGE := kanboard/kanboard
|
||||
DOCKER_IMAGE := docker.io/kanboard/kanboard
|
||||
DOCKER_TAG := master
|
||||
VERSION := $(shell git rev-parse --short HEAD)
|
||||
|
||||
.PHONY: all
|
||||
.PHONY: all clean static jshint archive test-sqlite test-mysql test-postgres test-browser \
|
||||
integration-test-mysql integration-test-postgres integration-test-sqlite sql \
|
||||
docker-image docker-manifest docker-run docker-sh
|
||||
|
||||
all: static
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@ rm -rf ./node_modules
|
||||
|
||||
.PHONY: static
|
||||
static: clean
|
||||
@ npm install
|
||||
@ ./node_modules/.bin/gulp vendor js css
|
||||
@ ./node_modules/.bin/jshint assets/js/{core,components,polyfills}
|
||||
|
||||
.PHONY: jshint
|
||||
jshint:
|
||||
@ ./node_modules/.bin/jshint assets/js/{core,components,polyfills}
|
||||
|
||||
.PHONY: archive
|
||||
archive:
|
||||
@ echo "Build archive: version=$(VERSION)"
|
||||
@ git archive --format=zip --prefix=kanboard/ $(VERSION) -o kanboard-$(VERSION).zip
|
||||
|
||||
.PHONY: test-sqlite
|
||||
test-sqlite:
|
||||
@ ./vendor/bin/phpunit -c tests/units.sqlite.xml
|
||||
|
||||
.PHONY: test-mysql
|
||||
test-mysql:
|
||||
@ ./vendor/bin/phpunit -c tests/units.mysql.xml
|
||||
|
||||
.PHONY: test-postgres
|
||||
test-postgres:
|
||||
@ ./vendor/bin/phpunit -c tests/units.postgres.xml
|
||||
|
||||
.PHONY: test-browser
|
||||
test-browser:
|
||||
@ ./vendor/bin/phpunit -c tests/acceptance.xml
|
||||
|
||||
.PHONY: integration-test-mysql
|
||||
integration-test-mysql:
|
||||
@ composer install --dev
|
||||
@ docker-compose -f tests/docker/compose.integration.mysql.yaml build
|
||||
@@ -48,7 +42,6 @@ integration-test-mysql:
|
||||
@ docker-compose -f tests/docker/compose.integration.mysql.yaml up tests
|
||||
@ docker-compose -f tests/docker/compose.integration.mysql.yaml down
|
||||
|
||||
.PHONY: integration-test-postgres
|
||||
integration-test-postgres:
|
||||
@ composer install --dev
|
||||
@ docker-compose -f tests/docker/compose.integration.postgres.yaml build
|
||||
@@ -56,7 +49,6 @@ integration-test-postgres:
|
||||
@ docker-compose -f tests/docker/compose.integration.postgres.yaml up tests
|
||||
@ docker-compose -f tests/docker/compose.integration.postgres.yaml down
|
||||
|
||||
.PHONY: integration-test-sqlite
|
||||
integration-test-sqlite:
|
||||
@ composer install --dev
|
||||
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml build
|
||||
@@ -64,7 +56,6 @@ integration-test-sqlite:
|
||||
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml up tests
|
||||
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml down
|
||||
|
||||
.PHONY: sql
|
||||
sql:
|
||||
@ pg_dump --schema-only --no-owner --no-privileges --quote-all-identifiers -n public --file app/Schema/Sql/postgres.sql kanboard
|
||||
@ pg_dump -d kanboard --column-inserts --data-only --table settings >> app/Schema/Sql/postgres.sql
|
||||
@@ -86,14 +77,35 @@ sql:
|
||||
|
||||
@ grep -v "SET idle_in_transaction_session_timeout = 0;" app/Schema/Sql/postgres.sql > temp && mv temp app/Schema/Sql/postgres.sql
|
||||
|
||||
.PHONY: docker-image
|
||||
docker-image:
|
||||
@ docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
|
||||
|
||||
.PHONY: docker-run
|
||||
docker-manifest:
|
||||
for version in $(VERSION) latest; do \
|
||||
docker build --build-arg VERSION=$${version} -t $(DOCKER_IMAGE):amd64-$${version} -f Dockerfile . && \
|
||||
docker build --build-arg VERSION=$${version} -t $(DOCKER_IMAGE):arm32v6-$${version} -f Dockerfile.arm32v6 . && \
|
||||
docker build --build-arg VERSION=$${version} -t $(DOCKER_IMAGE):arm32v7-$${version} -f Dockerfile.arm32v7 . && \
|
||||
docker build --build-arg VERSION=$${version} -t $(DOCKER_IMAGE):arm64v8-$${version} -f Dockerfile.arm64v8 . && \
|
||||
docker push $(DOCKER_IMAGE):amd64-$${version} && \
|
||||
docker push $(DOCKER_IMAGE):arm32v6-$${version} && \
|
||||
docker push $(DOCKER_IMAGE):arm32v7-$${version} && \
|
||||
docker push $(DOCKER_IMAGE):arm64v8-$${version} && \
|
||||
docker manifest create --amend $(DOCKER_IMAGE):$${version} \
|
||||
$(DOCKER_IMAGE):amd64-$${version} \
|
||||
$(DOCKER_IMAGE):arm32v6-$${version} \
|
||||
$(DOCKER_IMAGE):arm32v7-$${version} \
|
||||
$(DOCKER_IMAGE):arm64v8-$${version} && \
|
||||
docker manifest annotate $(DOCKER_IMAGE):$${version} \
|
||||
$(DOCKER_IMAGE):arm32v6-$${version} --os linux --arch arm --variant v6 && \
|
||||
docker manifest annotate $(DOCKER_IMAGE):$${version} \
|
||||
$(DOCKER_IMAGE):arm32v7-$${version} --os linux --arch arm --variant v7 && \
|
||||
docker manifest annotate $(DOCKER_IMAGE):$${version} \
|
||||
$(DOCKER_IMAGE):arm64v8-$${version} --os linux --arch arm64 --variant v8 && \
|
||||
docker manifest push --purge $(DOCKER_IMAGE):$${version} ;\
|
||||
done
|
||||
|
||||
docker-run:
|
||||
@ docker run --rm --name=kanboard -p 80:80 -p 443:443 $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||
|
||||
.PHONY: docker-sh
|
||||
docker-sh:
|
||||
@ docker exec -ti kanboard bash
|
||||
|
||||
Reference in New Issue
Block a user