git.iko.soy/typeable/oauth2-proxy
on master help sign in
fix(docker): simplify build by copying ca-certificates.crt
commitf289543dc6820ef81ea232f53f0ba9698d2e46c6 authorKarl Skewes <karl.skewes@gmail.com> dateSat 2 Feb 2019, 14:20 (8 years ago) parent90e6bd2
8 files changed+4−80
.travis.yml−3 BUILDING.md−52 CONTRIBUTING.md−1 Dockerfile+1−1 Dockerfile.arm64+1−3 Dockerfile.armv6+1−3 Makefile+1−15 README.md−2
.travis.yml−3
@@ -2,9 +2,6 @@ language: go
22go:
33 - 1.10.x
44 - 1.11.x
5−before_install:
6− - sudo apt-get install -y qemu-user-static
7− - sudo docker run --rm --privileged multiarch/qemu-user-static:register
85install:
96 # Fetch dependencies
107 - wget -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
BUILDING.mddeleted−52
@@ -1,52 +0,0 @@
1−# Building
2−
3−This project is setup to build on amd64.
4−
5−It is also possible to cross build binaries and docker images for armv6 and arm64.
6−
7−## Clone repo and configure
8−
9−```bash
10−cd $GOPATH/src/github.com # Create this directory if it doesn't exist
11−git clone git@github.com:<YOUR_FORK>/oauth2_proxy pusher/oauth2_proxy
12−cd pusher/oauth2_proxy
13−./configure # Setup your environment variables
14−make dep
15−```
16−
17−## Building amd64
18−
19−Build binary:
20−```bash
21−make
22−```
23−
24−Build docker image:
25−```bash
26−make docker
27−```
28−
29−## Building for other architectures
30−
31−This requires [multiarch/qemu-user-static](https://github.com/multiarch/qemu-user-static) to be installed in your system.
32−On Ubuntu:
33−```bash
34−sudo apt install qemu-user-static
35−```
36−
37−Register `qemu-user-static` on your system:
38−```bash
39−# make qemu-register
40−# or
41−sudo docker run --rm --privileged multiarch/qemu-user-static:register
42−```
43−
44−Build all binaries:
45−```bash
46−make release
47−```
48−
49−Build all docker images:
50−```bash
51−make docker-all
52−```
CONTRIBUTING.md−1
@@ -5,7 +5,6 @@ To develop on this project, please fork the repo and clone into your `$GOPATH`.
55Dependencies are **not** checked in so please download those separately.
66Download the dependencies using [`dep`](https://github.com/golang/dep).
77
8−
98```bash
109cd $GOPATH/src/github.com # Create this directory if it doesn't exist
1110git clone git@github.com:<YOUR_FORK>/oauth2_proxy pusher/oauth2_proxy
Dockerfile+1−1
@@ -16,7 +16,7 @@ RUN ./configure && make build
1616
1717# Copy binary to alpine
1818FROM 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
2020COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
2121
2222ENTRYPOINT ["/bin/oauth2_proxy"]
Dockerfile.arm64+1−3
@@ -16,9 +16,7 @@ RUN ./configure && GOARCH=arm64 make build
1616
1717# Copy binary to alpine
1818FROM arm64v8/alpine:3.8
19−COPY dist/qemu-aarch64-static /usr/bin/
20−RUN apk add --no-cache ca-certificates
19+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2120COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
22−RUN rm /usr/bin/qemu-*-static -f
2321
2422ENTRYPOINT ["/bin/oauth2_proxy"]
Dockerfile.armv6+1−3
@@ -16,9 +16,7 @@ RUN ./configure && GOARCH=arm GOARM=6 make build
1616
1717# Copy binary to alpine
1818FROM arm32v6/alpine:3.8
19−COPY dist/qemu-arm-static /usr/bin/
20−RUN apk add --no-cache ca-certificates
19+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2120COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy
22−RUN rm /usr/bin/qemu-*-static -f
2321
2422ENTRYPOINT ["/bin/oauth2_proxy"]
Makefile+1−15
@@ -45,26 +45,12 @@ build: clean $(BINARY)
4545$(BINARY):
4646 CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/pusher/oauth2_proxy
4747
48−# Ubuntu 18.04.1 Qemu version
49−QEMU-STATIC-VERSION=v2.11.1
50−
51−.PHONY: qemu-static
52−qemu-static:
53− wget -O dist/qemu-amd64-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-x86_64-static
54− wget -O dist/qemu-aarch64-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-aarch64-static
55− wget -O dist/qemu-arm-static https://github.com/multiarch/qemu-user-static/releases/download/${QEMU-STATIC-VERSION}/qemu-arm-static
56− chmod +x dist/qemu-*-static
57−
58−.PHONY: qemu-register
59−qemu-register:
60− docker run --rm --privileged multiarch/qemu-user-static:register
61−
6248.PHONY: docker
6349docker:
6450 docker build -f Dockerfile -t pusher/oauth2_proxy:latest .
6551
6652.PHONY: docker-all
67−docker-all: qemu-static docker
53+docker-all: docker
6854 docker build -f Dockerfile -t pusher/oauth2_proxy:latest-amd64 .
6955 docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION} .
7056 docker build -f Dockerfile -t pusher/oauth2_proxy:${VERSION}-amd64 .
README.md−2
@@ -25,8 +25,6 @@ A list of changes can be seen in the [CHANGELOG](CHANGELOG.md).
2525
2626 c. Using the prebuilt docker image [quay.io/pusher/oauth2_proxy](https://quay.io/pusher/oauth2_proxy)
2727
28− d. Building from scratch following our [Building](BUILDING.md) guide
29−
3028Prebuilt binaries can be validated by extracting the file and verifying it against the `sha256sum.txt` checksum file provided for each release starting with version `v3.0.0`.
3129
3230```