Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:3.4

ENV BUILD_PKGS="ca-certificates wget"

ENV OAUTH2_PROXY_VERSION="2.1"
ENV OAUTH2_PROXY_PKG="oauth2_proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.go1.6"
RUN apk update && \
apk upgrade && \
apk add $BUILD_PKGS && \
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 && \
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/*

EXPOSE 4180

ENTRYPOINT ["oauth2_proxy"]
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# docker-oauth2-proxy
Docker image for oauth2_proxy, a reverse proxy that provides authentication with Google, Github or other providers
# Docker OAuth2 Proxy

[![CircleCI](https://circleci.com/gh/Intellection/docker-oauth2-proxy/tree/master.svg?style=shield)](https://circleci.com/gh/Intellection/docker-oauth2-proxy/tree/master)

This is a small docker image for `oauth2_proxy` which is a reverse proxy
that provides authentication with Google, GitHub or other providers.

## Configuration

Configure OAuth2 Proxy using config file, command line options, or
environment variables. See [`bitly/oauth2_proxy` documentation][1] for
more details.

## Usage

Run without parameters or any configuration:

# Will error out because of no configuration
$ docker run zappi/oauth2_proxy
2016/09/16 10:19:26 main.go:99: Invalid configuration:
missing setting: upstream
missing setting: cookie-secret
missing setting: client-id
missing setting: client-secret
missing setting for email validation: email-domain or authenticated-emails-file required.
use email-domain=* to authorize all email addresses

Check version:

$ docker run zappi/oauth2_proxy --version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't get us a bash shell.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9d1db07.


[1]: https://github.com/bitly/oauth2_proxy
22 changes: 22 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
environment:
IMAGE_NAME: 'zappi/oauth2_proxy'
services:
- docker

test:
pre:
- docker build --tag=$IMAGE_NAME .
override:
- docker run $IMAGE_NAME --version

deployment:
tagged:
tag: /.*/
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these environment variables be set up as secrets in Circle CI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno. 😰

I'm also wondering who's details should I use.

- docker tag $IMAGE_NAME $IMAGE_NAME:$CIRCLE_TAG
- docker push $IMAGE_NAME:$CIRCLE_TAG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also push the latest tag?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see you've added it in another commit. Can they not be pushed together?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could but I'm not sure it works i.e. does it overwrite? will it error out due to a conflict like ECR?

Copy link
Member Author

@itskingori itskingori Sep 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I'd like to revert just that specific change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's just have it push the Git tag and see what happens first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's just have it push the Git tag and see what happens first?

Dropped latest push for now. We can do it later.