From 7d72ad98ccce0ff23f0da451a72feae65cf49c76 Mon Sep 17 00:00:00 2001
From: Rohith <gambol99@gmail.com>
Date: Tue, 21 Jun 2016 11:11:49 +0100
Subject: [PATCH] - adding a user in the docker file to ensure we dont run as
 root (#104)

- shifting the version to v1.2.1
---
 Dockerfile | 6 +++++-
 Makefile   | 8 +++++++-
 doc.go     | 2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 385ca3d..1ba2fb7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,9 @@ FROM alpine:3.3
 MAINTAINER Rohith <gambol99@gmail.com>
 
 RUN apk update && \
-    apk add ca-certificates
+    apk add ca-certificates && \
+    adduser -S proxy && \
+    addgroup -S proxy
 
 ADD templates/ opt/templates
 ADD bin/keycloak-proxy /opt/keycloak-proxy
@@ -10,4 +12,6 @@ RUN chmod +x /opt/keycloak-proxy
 
 WORKDIR "/opt"
 
+USER proxy
+
 ENTRYPOINT [ "/opt/keycloak-proxy" ]
diff --git a/Makefile b/Makefile
index dcd6e80..3882d00 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-
 NAME=keycloak-proxy
 AUTHOR=gambol99
 AUTHOR_EMAIL=gambol99@gmail.com
@@ -41,6 +40,13 @@ docker-build:
 	${SUDO} docker run --rm -v ${ROOT_DIR}:/go/src/github.com/gambol99/keycloak-proxy \
 		-w /go/src/github.com/gambol99/keycloak-proxy -e GOOS=linux golang:${GOVERSION} make static
 
+docker-test:
+	@echo "--> Running the docker test"
+	${SUDO} docker run --rm -ti -p 3000:3000 \
+	    -v ${ROOT_DIR}/config.yml:/etc/keycloak/config.yml:ro \
+	    -v ${ROOT_DIR}/tests:/opt/tests:ro \
+	    ${REGISTRY}/${AUTHOR}/${NAME}:${VERSION} --config /etc/keycloak/config.yml
+
 docker:
 	@echo "--> Building the docker image"
 	${SUDO} docker build -t ${REGISTRY}/${AUTHOR}/${NAME}:${VERSION} .
diff --git a/doc.go b/doc.go
index d1fa9df..63da324 100644
--- a/doc.go
+++ b/doc.go
@@ -21,7 +21,7 @@ import (
 )
 
 var (
-	release = "v1.2.0"
+	release = "v1.2.1"
 	gitsha  = "no gitsha provided"
 	version = release + " (git+sha: " + gitsha + ")"
 )
-- 
GitLab