diff options
author | Maka0 <Maka0@users.noreply.github.com> | 2020-06-15 23:20:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 23:20:59 +0300 |
commit | cd07ed644f67719c5d0a43636a84763ff4ce95d4 (patch) | |
tree | 948b85a78662e00c655356652c93e9d16c2690a2 | |
parent | ab71fac9e9f075be3883e5fee4da83417b08e2ad (diff) |
Updated Makefile to build multi-arch containers (#93)
Co-authored-by: Maka0 <bas@oddens.net>
-rw-r--r-- | Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -35,6 +35,14 @@ endif geoip-download: $(databases) +# Create an environment to build multiarch containers (https://github.com/docker/buildx/) +docker-multiarch-builder: + DOCKER_BUILDKIT=1 $(DOCKER) build -o . git://github.com/docker/buildx + mkdir -p ~/.docker/cli-plugins + mv buildx ~/.docker/cli-plugins/docker-buildx + $(DOCKER) buildx create --name multiarch-builder --node multiarch-builder --driver docker-container --use + $(DOCKER) run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker-build: $(DOCKER) build -t $(DOCKER_IMAGE) . @@ -46,8 +54,8 @@ docker-test: $(eval DOCKER_PORT=$(shell $(DOCKER) port $(CONTAINER) | cut -d ":" -f 2)) curl -fsS -m 5 localhost:$(DOCKER_PORT) > /dev/null; $(DOCKER) stop $(CONTAINER) -docker-push: docker-test docker-login - $(DOCKER) push $(DOCKER_IMAGE) +docker-push: docker-test docker-multiarch-builder docker-login + $(DOCKER) buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t $(DOCKER_IMAGE) --push . heroku-run: geoip-download ifndef PORT |