From 308bcc06a4ee1ffc7b168600d445b540243ce4ab Mon Sep 17 00:00:00 2001 From: Karl Skewes Date: Fri, 3 May 2019 18:38:03 +1200 Subject: [PATCH] fix Docker user on arm Use simple USER directive. Using `addgroup` in final `arm` image when building on amd64 doesn't work. I must have made a mistake during cross build verification. Alternative is to use qemu-static but it's not worth it for this. --- CHANGELOG.md | 1 + Dockerfile | 3 +-- Dockerfile.arm64 | 5 ++--- Dockerfile.armv6 | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f892f6b..8425bae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Changes since v3.2.0 +- [#142](https://github.com/pusher/oauth2_proxy/pull/142) ARM Docker USER fix (@kskewes) - [#52](https://github.com/pusher/oauth2_proxy/pull/52) Logging Improvements (@MisterWil) - Implement flags to configure file logging - `-logging-filename` Defines the filename to log to diff --git a/Dockerfile b/Dockerfile index 09db37a..a734e27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,6 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifi COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/jwt_signing_key.pem /etc/ssl/private/jwt_signing_key.pem -RUN addgroup -S -g 2000 oauth2proxy && adduser -S -u 2000 oauth2proxy -G oauth2proxy -USER oauth2proxy +USER 2000:2000 ENTRYPOINT ["/bin/oauth2_proxy"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index d9eb0f6..7fdb2f8 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -1,4 +1,4 @@ -FROM golang:1.11-stretch AS builder +FROM golang:1.12-stretch AS builder # Download tools RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 @@ -25,7 +25,6 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifi COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/jwt_signing_key.pem /etc/ssl/private/jwt_signing_key.pem -RUN addgroup -S -g 2000 oauth2proxy && adduser -S -u 2000 oauth2proxy -G oauth2proxy -USER oauth2proxy +USER 2000:2000 ENTRYPOINT ["/bin/oauth2_proxy"] diff --git a/Dockerfile.armv6 b/Dockerfile.armv6 index acd57d0..dfe4fe2 100644 --- a/Dockerfile.armv6 +++ b/Dockerfile.armv6 @@ -1,4 +1,4 @@ -FROM golang:1.11-stretch AS builder +FROM golang:1.12-stretch AS builder # Download tools RUN wget -O $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 @@ -25,7 +25,6 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifi COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/oauth2_proxy /bin/oauth2_proxy COPY --from=builder /go/src/github.com/pusher/oauth2_proxy/jwt_signing_key.pem /etc/ssl/private/jwt_signing_key.pem -RUN addgroup -S -g 2000 oauth2proxy && adduser -S -u 2000 oauth2proxy -G oauth2proxy -USER oauth2proxy +USER 2000:2000 ENTRYPOINT ["/bin/oauth2_proxy"]