Skip to content

Instantly share code, notes, and snippets.

@shbatm
Created January 15, 2019 14:07
Show Gist options
  • Save shbatm/e0f138da7418ab5970b3f89475195c49 to your computer and use it in GitHub Desktop.
Save shbatm/e0f138da7418ab5970b3f89475195c49 to your computer and use it in GitHub Desktop.
Build & Install pusher/oauth2_proxy on Raspberry Pi

Build & Install pusher/oauth2_proxy on Raspberry Pi

1. Install Latest golang

git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh

2. Create $GOPATH directory and ENV variable

mkdir -p ~/go/src
echo "export GOPATH=$HOME/go" >> ~/.profile
. ~/.profile

3. Clone oauth2_proxy repo and build

cd ~/go/src
git clone https://github.com/pusher/oauth2_proxy
cd oauth2_proxy
go get ./...
go build

4. Manually Build Docker Image

docker build -t pusher/oauth2_proxy_arm:latest .

5. Create operational directory

mkdir -p ~/oauth2_proxy/config
# Customize and put the docker-compose.yml below in ~/oauth2_proxy
cp ~/go/src/oauth2_proxy/contrib/oauth2_proxy.cfg.example ~/oauth2_proxy/config/oauth2_proxy.cfg

6. Run the Docker image

cd ~/oauth2_proxy
docker-compose up -d
version: '3'
services:
oauth2_proxy:
container_name: oauth2_proxy
image: pusher/oauth2_proxy_arm
network_mode: host
restart: always
volumes:
- '$HOME/oauth2_proxy/config:/config'
- '/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt'
ports:
- "4180:4180"
command: [
"--config=/config/oauth2_proxy.cfg"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment