Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpolden/echoip.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaka0 <Maka0@users.noreply.github.com>2020-06-15 23:20:59 +0300
committerGitHub <noreply@github.com>2020-06-15 23:20:59 +0300
commitcd07ed644f67719c5d0a43636a84763ff4ce95d4 (patch)
tree948b85a78662e00c655356652c93e9d16c2690a2
parentab71fac9e9f075be3883e5fee4da83417b08e2ad (diff)
Updated Makefile to build multi-arch containers (#93)
Co-authored-by: Maka0 <bas@oddens.net>
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d1e3518..e3a5cd5 100644
--- a/Makefile
+++ b/Makefile
@@ -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