1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2026-05-22 10:15:21 +02:00

feat(arm): Cross build arm and arm64 docker images

- Requires `qemu-user-static`, added to travis - maybe incorrect?
- Add build guide
- `.gitignore` `release/` directory
This commit is contained in:
Karl Skewes
2019-02-02 12:08:19 +13:00
parent 2bdf00a692
commit 90e6bd278e
9 changed files with 138 additions and 0 deletions
+28
View File
@@ -45,6 +45,34 @@ build: clean $(BINARY)
$(BINARY):
CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/pusher/oauth2_proxy
# Ubuntu 18.04.1 Qemu version
QEMU-STATIC-VERSION=v2.11.1
.PHONY: qemu-static
qemu-static:
wget -O dist/qemu-amd64-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-x86_64-static
wget -O dist/qemu-aarch64-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-aarch64-static
wget -O dist/qemu-arm-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-arm-static
chmod +x dist/qemu-*-static
.PHONY: qemu-register
qemu-register:
docker run --rm --privileged multiarch/qemu-user-static:register
.PHONY: docker
docker:
docker build -f Dockerfile -t pusher/oauth2_proxy:latest .
.PHONY: docker-all
docker-all: qemu-static docker
docker build -f Dockerfile -t pusher/oauth2_proxy:latest-amd64 .
docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION} .
docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION}-amd64 .
docker build -f Dockerfile.arm64 -t pusher/oauth2_proxy:latest-arm64 .
docker build -f Dockerfile.arm64 -t pusher/oauth2_proxy:${VERSION}-arm64 .
docker build -f Dockerfile.armv6 -t pusher/oauth2_proxy:latest-armv6 .
docker build -f Dockerfile.armv6 -t pusher/oauth2_proxy:${VERSION}-armv6 .
.PHONY: test
test: dep lint
$(GO) test -v -race $(go list ./... | grep -v /vendor/)