git.iko.soy/typeable/oauth2-proxy
on master help sign in
Merge pull request #37 from kskewes/dockerarm
92c4424Joel Speed
.gitignore+1
@@ -1,6 +1,7 @@
1oauth2_proxy
1oauth2_proxy
2vendor
2vendor
3dist
3dist
4+release
4.godeps
5.godeps
5*.exe
6*.exe
6.env
7.env
CHANGELOG.md+1
@@ -18,6 +18,7 @@
18 - After a successful login, you will be redirected to your original URL rather than /
18 - After a successful login, you will be redirected to your original URL rather than /
19- [#35](https://github.com/pusher/oauth2_proxy/pull/35) arm and arm64 binary releases (@kskewes)
19- [#35](https://github.com/pusher/oauth2_proxy/pull/35) arm and arm64 binary releases (@kskewes)
20 - Add armv6 and arm64 to Makefile `release` target
20 - Add armv6 and arm64 to Makefile `release` target
21+- [#37](https://github.com/pusher/oauth2_proxy/pull/37) cross build arm and arm64 docker images (@kskewes)
21
22
22# v3.0.0
23# v3.0.0
23
24
CONTRIBUTING.md+2
@@ -8,6 +8,8 @@ Download the dependencies using [`dep`](https://github.com/golang/dep).
8```bash
8```bash
9cd $GOPATH/src/github.com # Create this directory if it doesn't exist
9cd $GOPATH/src/github.com # Create this directory if it doesn't exist
10git clone git@github.com:<YOUR_FORK>/oauth2_proxy pusher/oauth2_proxy
10git clone git@github.com:<YOUR_FORK>/oauth2_proxy pusher/oauth2_proxy
11+cd pusher/oauth2_proxy
12+./configure # Setup your environment variables
11make dep
13make dep
12```
14```
13
15
Dockerfile+1−1
@@ -16,7 +16,7 @@ RUN ./configure && make build
16
16
17# Copy binary to alpine
17# Copy binary to alpine
18FROM alpine:3.8
18FROM alpine:3.8
19−RUN apk add --no-cache ca-certificates
19+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
20COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
20COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
21
21
22ENTRYPOINT ["/bin/oauth2_proxy"]
22ENTRYPOINT ["/bin/oauth2_proxy"]
Dockerfile.arm64new file+22
@@ -0,0 +1,22 @@
1+FROM golang:1.11-stretch AS builder
2+
3+# Download tools
4+RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
5+RUN chmod +x $GOPATH/bin/dep
6+
7+# Copy sources
8+WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy
9+COPY . .
10+
11+# Fetch dependencies
12+RUN dep ensure --vendor-only
13+
14+# Build binary
15+RUN ./configure && GOARCH=arm64 make build
16+
17+# Copy binary to alpine
18+FROM arm64v8/alpine:3.8
19+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
20+COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
21+
22+ENTRYPOINT ["/bin/oauth2_proxy"]
Dockerfile.armv6new file+22
@@ -0,0 +1,22 @@
1+FROM golang:1.11-stretch AS builder
2+
3+# Download tools
4+RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
5+RUN chmod +x $GOPATH/bin/dep
6+
7+# Copy sources
8+WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy
9+COPY . .
10+
11+# Fetch dependencies
12+RUN dep ensure --vendor-only
13+
14+# Build binary
15+RUN ./configure && GOARCH=arm GOARM=6 make build
16+
17+# Copy binary to alpine
18+FROM arm32v6/alpine:3.8
19+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
20+COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
21+
22+ENTRYPOINT ["/bin/oauth2_proxy"]
Makefile+14
@@ -45,6 +45,20 @@ build: clean $(BINARY)
45$(BINARY):
45$(BINARY):
46 CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/pusher/oauth2_proxy
46 CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/pusher/oauth2_proxy
47
47
48+.PHONY: docker
49+docker:
50+ docker build -f Dockerfile -t pusher/oauth2_proxy:latest .
51+
52+.PHONY: docker-all
53+docker-all: docker
54+ docker build -f Dockerfile -t pusher/oauth2_proxy:latest-amd64 .
55+ docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION} .
56+ docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION}-amd64 .
57+ docker build -f Dockerfile.arm64 -t pusher/oauth2_proxy:latest-arm64 .
58+ docker build -f Dockerfile.arm64 -t pusher/oauth2_proxy:${VERSION}-arm64 .
59+ docker build -f Dockerfile.armv6 -t pusher/oauth2_proxy:latest-armv6 .
60+ docker build -f Dockerfile.armv6 -t pusher/oauth2_proxy:${VERSION}-armv6 .
61+
48.PHONY: test
62.PHONY: test
49test: dep lint
63test: dep lint
50 $(GO) test -v -race $(go list ./... | grep -v /vendor/)
64 $(GO) test -v -race $(go list ./... | grep -v /vendor/)