1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-21 00:29:44 +02:00

Fix docker build and push for all platforms

This commit is contained in:
Joel Speed
2021-11-14 17:50:12 +00:00
committed by Joel Speed
parent 6e54ac2745
commit 60b6dd850a

View File

@ -41,36 +41,38 @@ $(BINARY):
DOCKER_BUILD_PLATFORM ?= linux/amd64,linux/arm64,linux/arm/v6 DOCKER_BUILD_PLATFORM ?= linux/amd64,linux/arm64,linux/arm/v6
DOCKER_BUILDX_ARGS ?= DOCKER_BUILDX_ARGS ?=
DOCKER_BUILD := docker build --build-arg VERSION=${VERSION} DOCKER_BUILDX := docker buildx build ${DOCKER_BUILDX_ARGS} --build-arg VERSION=${VERSION}
DOCKER_BUILDX := docker buildx build ${DOCKER_BUILDX_ARGS} --platform ${DOCKER_BUILD_PLATFORM} --build-arg VERSION=${VERSION} DOCKER_BUILDX_X_PLATFORM := $(DOCKER_BUILDX) --platform ${DOCKER_BUILD_PLATFORM}
DOCKER_BUILDX_PUSH := docker buildx build --push
DOCKER_BUILDX_PUSH_X_PLATFORM := $(DOCKER_BUILDX_PUSH) --platform ${DOCKER_BUILD_PLATFORM}
.PHONY: docker .PHONY: docker
docker: docker:
$(DOCKER_BUILDX) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest . $(DOCKER_BUILDX_X_PLATFORM) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest .
.PHONY: docker-all .PHONY: docker-all
docker-all: docker docker-all: docker
$(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest-amd64 . $(DOCKER_BUILDX) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest-amd64 .
$(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION} . $(DOCKER_BUILDX_X_PLATFORM) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION} .
$(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 . $(DOCKER_BUILDX) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 .
$(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:latest-arm64 . $(DOCKER_BUILDX) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:latest-arm64 .
$(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 . $(DOCKER_BUILDX) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 .
$(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:latest-armv6 . $(DOCKER_BUILDX) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:latest-armv6 .
$(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 . $(DOCKER_BUILDX) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 .
.PHONY: docker-push .PHONY: docker-push
docker-push: docker-push:
docker buildx build --push --platform ${DOCKER_BUILD_PLATFORM} -t $(REGISTRY)/oauth2-proxy:latest . $(DOCKER_BUILDX_PUSH_X_PLATFORM) -t $(REGISTRY)/oauth2-proxy:latest .
.PHONY: docker-push-all .PHONY: docker-push-all
docker-push-all: docker-push docker-push-all: docker-push
docker push $(REGISTRY)/oauth2-proxy:latest-amd64 $(DOCKER_BUILDX_PUSH) -t $(REGISTRY)/oauth2-proxy:latest-amd64 .
docker push $(REGISTRY)/oauth2-proxy:${VERSION} $(DOCKER_BUILDX_PUSH_X_PLATFORM) -t $(REGISTRY)/oauth2-proxy:${VERSION} .
docker push $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 $(DOCKER_BUILDX_PUSH) -t $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 .
docker push $(REGISTRY)/oauth2-proxy:latest-arm64 $(DOCKER_BUILDX_PUSH) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:latest-arm64 .
docker push $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 $(DOCKER_BUILDX_PUSH) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 .
docker push $(REGISTRY)/oauth2-proxy:latest-armv6 $(DOCKER_BUILDX_PUSH) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:latest-armv6 .
docker push $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 $(DOCKER_BUILDX_PUSH) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 .
.PHONY: generate .PHONY: generate
generate: generate: