From 074c0c380eea9cadcf0b20d91ac2622265c41c31 Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:40:42 +0200 Subject: [PATCH 1/8] Update base image to debian strech --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 973ae36..1679326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,20 @@ -FROM alpine:3.4 +FROM debian:stretch-slim -ENV APP_PKGS="ca-certificates" -ENV BUILD_PKGS="wget" +ARG OAUTH2_PROXY_VERSION="2.1" +ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go1.6" +ARG OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" -ENV OAUTH2_PROXY_VERSION="2.1" -ENV OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go1.6" \ - OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" -RUN apk update && \ - apk upgrade && \ - apk add $APP_PKGS $BUILD_PKGS && \ - mkdir -p /var/tmp/oauth2_proxy && \ +RUN apt-get update -y && \ + apt-get install --no-install-recommends -y \ + ca-certificates wget && \ + rm -rf /tmp/* /var/{cache,log,tmp} /var/lib/{apt,dpkg,cache,log} + +RUN mkdir -p /var/tmp/oauth2_proxy && \ cd /var/tmp/oauth2_proxy && \ wget --progress=dot:mega https://github.com/bitly/oauth2_proxy/releases/download/v${OAUTH2_PROXY_VERSION}/${OAUTH2_PROXY_PKG}.tar.gz && \ echo "${OAUTH2_PROXY_SHA} *${OAUTH2_PROXY_PKG}.tar.gz" | sha256sum -c - && \ tar xvf ${OAUTH2_PROXY_PKG}.tar.gz && \ - cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ && \ - apk del $BUILD_PKGS && \ - rm -rf /var/cache/apk/* + cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ EXPOSE 4180 From 065470acb18e85b437c761aec76c00da17e2e329 Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:42:08 +0200 Subject: [PATCH 2/8] Extract golang version into argument --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1679326..b422e9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM debian:stretch-slim ARG OAUTH2_PROXY_VERSION="2.1" -ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go1.6" +ARG OAUTH2_PROXY_GOLANG_VERSION="1.6" +ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" ARG OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" RUN apt-get update -y && \ From e571b7fac812426c2c60f6fe452cbb2a85a3b26a Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:44:48 +0200 Subject: [PATCH 3/8] Move arguments further down the dockerfile --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b422e9a..3fd8d4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM debian:stretch-slim -ARG OAUTH2_PROXY_VERSION="2.1" -ARG OAUTH2_PROXY_GOLANG_VERSION="1.6" -ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" -ARG OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" - RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ ca-certificates wget && \ rm -rf /tmp/* /var/{cache,log,tmp} /var/lib/{apt,dpkg,cache,log} +ARG OAUTH2_PROXY_VERSION="2.1" +ARG OAUTH2_PROXY_GOLANG_VERSION="1.6" +ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" +ARG OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" + RUN mkdir -p /var/tmp/oauth2_proxy && \ cd /var/tmp/oauth2_proxy && \ wget --progress=dot:mega https://github.com/bitly/oauth2_proxy/releases/download/v${OAUTH2_PROXY_VERSION}/${OAUTH2_PROXY_PKG}.tar.gz && \ From 9fbc7a1eb3b6127fef6b3098d4d72064376b469e Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:51:45 +0200 Subject: [PATCH 4/8] Upgrade to oauth2 proxy version 2.2 --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3fd8d4f..e89a483 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,11 @@ RUN apt-get update -y && \ ca-certificates wget && \ rm -rf /tmp/* /var/{cache,log,tmp} /var/lib/{apt,dpkg,cache,log} -ARG OAUTH2_PROXY_VERSION="2.1" -ARG OAUTH2_PROXY_GOLANG_VERSION="1.6" -ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" -ARG OAUTH2_PROXY_SHA="3061e5b04bd14eeb9ec0ad1c9b324ba8d99d50eaadc5f528cdf4d21043828298" +ARG OAUTH2_PROXY_VERSION="2.2" +ARG OAUTH2_PROXY_GOLANG_VERSION="1.8.1" +ARG OAUTH2_PROXY_PKG_VERSION="2.2.0" +ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_PKG_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" +ARG OAUTH2_PROXY_SHA="1c16698ed0c85aa47aeb80e608f723835d9d1a8b98bd9ae36a514826b3acce56" RUN mkdir -p /var/tmp/oauth2_proxy && \ cd /var/tmp/oauth2_proxy && \ From ae94d1f186c2ac66079b2ea194eeec0d1102d635 Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:52:09 +0200 Subject: [PATCH 5/8] Bump version and update CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f59bb7..6efe4cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.2 + +* Switch to Debian Stretch base image. +* Upgrade `oauth2_proxy` to v2.2. + ## 2.1-2 * Fix 500 Internal Error Internal Error when sending POST to Google From a0352f5a45c6db045f5ed66c008e0263f324b901 Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:54:15 +0200 Subject: [PATCH 6/8] Add CODEOWNERS file --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..c907cbc --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @itskingori @tsu-shiuan @zacblazic From 1dddf4293e63c6aaad1465af0675f820e9df015e Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 12:59:30 +0200 Subject: [PATCH 7/8] Cleanup /var/tmp --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e89a483..71113de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ RUN mkdir -p /var/tmp/oauth2_proxy && \ wget --progress=dot:mega https://github.com/bitly/oauth2_proxy/releases/download/v${OAUTH2_PROXY_VERSION}/${OAUTH2_PROXY_PKG}.tar.gz && \ echo "${OAUTH2_PROXY_SHA} *${OAUTH2_PROXY_PKG}.tar.gz" | sha256sum -c - && \ tar xvf ${OAUTH2_PROXY_PKG}.tar.gz && \ - cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ + cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ && + rm -rf /var/tmp/oauth2_proxy EXPOSE 4180 From 0f71fa5a22cec01f3580eb1aacfd501f831d0985 Mon Sep 17 00:00:00 2001 From: Zac Blazic Date: Fri, 28 Sep 2018 13:01:42 +0200 Subject: [PATCH 8/8] Use a single RUN command in dockerfile --- Dockerfile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71113de..ac36e74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,21 @@ FROM debian:stretch-slim -RUN apt-get update -y && \ - apt-get install --no-install-recommends -y \ - ca-certificates wget && \ - rm -rf /tmp/* /var/{cache,log,tmp} /var/lib/{apt,dpkg,cache,log} - ARG OAUTH2_PROXY_VERSION="2.2" ARG OAUTH2_PROXY_GOLANG_VERSION="1.8.1" ARG OAUTH2_PROXY_PKG_VERSION="2.2.0" ARG OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_PKG_VERSION}.linux-amd64.go${OAUTH2_PROXY_GOLANG_VERSION}" ARG OAUTH2_PROXY_SHA="1c16698ed0c85aa47aeb80e608f723835d9d1a8b98bd9ae36a514826b3acce56" -RUN mkdir -p /var/tmp/oauth2_proxy && \ +RUN apt-get update -y && \ + apt-get install --no-install-recommends -y \ + ca-certificates wget && \ + mkdir -p /var/tmp/oauth2_proxy && \ cd /var/tmp/oauth2_proxy && \ wget --progress=dot:mega https://github.com/bitly/oauth2_proxy/releases/download/v${OAUTH2_PROXY_VERSION}/${OAUTH2_PROXY_PKG}.tar.gz && \ echo "${OAUTH2_PROXY_SHA} *${OAUTH2_PROXY_PKG}.tar.gz" | sha256sum -c - && \ tar xvf ${OAUTH2_PROXY_PKG}.tar.gz && \ - cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ && - rm -rf /var/tmp/oauth2_proxy + cp /var/tmp/oauth2_proxy/${OAUTH2_PROXY_PKG}/oauth2_proxy /bin/ && \ + rm -rf /tmp/* /var/{cache,log,tmp} /var/lib/{apt,dpkg,cache,log} EXPOSE 4180