Support Go 1.13.x and allow to override REGISTRY (#273)

Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
This commit is contained in:
Dhi Aurrahman
2019-10-07 13:53:46 -07:00
committed by Dan Bond
parent ac10bc04ed
commit de16df232d
8 changed files with 82 additions and 508 deletions
+18 -16
View File
@@ -1,6 +1,8 @@
include .env
BINARY := oauth2_proxy
VERSION := $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
# Allow to override image registry.
REGISTRY ?= quay.io/pusher
.NOTPARALLEL:
.PHONY: all
@@ -27,31 +29,31 @@ $(BINARY):
.PHONY: docker
docker:
docker build -f Dockerfile -t quay.io/pusher/oauth2_proxy:latest .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:latest .
.PHONY: docker-all
docker-all: docker
docker build -f Dockerfile -t quay.io/pusher/oauth2_proxy:latest-amd64 .
docker build -f Dockerfile -t quay.io/pusher/oauth2_proxy:${VERSION} .
docker build -f Dockerfile -t quay.io/pusher/oauth2_proxy:${VERSION}-amd64 .
docker build -f Dockerfile.arm64 -t quay.io/pusher/oauth2_proxy:latest-arm64 .
docker build -f Dockerfile.arm64 -t quay.io/pusher/oauth2_proxy:${VERSION}-arm64 .
docker build -f Dockerfile.armv6 -t quay.io/pusher/oauth2_proxy:latest-armv6 .
docker build -f Dockerfile.armv6 -t quay.io/pusher/oauth2_proxy:${VERSION}-armv6 .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:latest-amd64 .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:${VERSION} .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:${VERSION}-amd64 .
docker build -f Dockerfile.arm64 -t $(REGISTRY)/oauth2_proxy:latest-arm64 .
docker build -f Dockerfile.arm64 -t $(REGISTRY)/oauth2_proxy:${VERSION}-arm64 .
docker build -f Dockerfile.armv6 -t $(REGISTRY)/oauth2_proxy:latest-armv6 .
docker build -f Dockerfile.armv6 -t $(REGISTRY)/oauth2_proxy:${VERSION}-armv6 .
.PHONY: docker-push
docker-push:
docker push quay.io/pusher/oauth2_proxy:latest
docker push $(REGISTRY)/oauth2_proxy:latest
.PHONY: docker-push-all
docker-push-all: docker-push
docker push quay.io/pusher/oauth2_proxy:latest-amd64
docker push quay.io/pusher/oauth2_proxy:${VERSION}
docker push quay.io/pusher/oauth2_proxy:${VERSION}-amd64
docker push quay.io/pusher/oauth2_proxy:latest-arm64
docker push quay.io/pusher/oauth2_proxy:${VERSION}-arm64
docker push quay.io/pusher/oauth2_proxy:latest-armv6
docker push quay.io/pusher/oauth2_proxy:${VERSION}-armv6
docker push $(REGISTRY)/oauth2_proxy:latest-amd64
docker push $(REGISTRY)/oauth2_proxy:${VERSION}
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-amd64
docker push $(REGISTRY)/oauth2_proxy:latest-arm64
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-arm64
docker push $(REGISTRY)/oauth2_proxy:latest-armv6
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-armv6
.PHONY: test
test: lint