Skip to content

Commit

Permalink
Using non root user in controller
Browse files Browse the repository at this point in the history
Have done some basic testing.
Would like some feedback.
  • Loading branch information
Himavanth committed Apr 25, 2018
1 parent 5ebff8f commit 884bb91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

FROM scala

ENV UID=1001 \
NOT_ROOT_USER=runtimeuser

# Install swagger-ui
RUN curl -sSL -o swagger-ui-v3.6.0.tar.gz --no-verbose https://github.com/swagger-api/swagger-ui/archive/v3.6.0.tar.gz && \
mkdir swagger-ui && \
Expand All @@ -30,5 +33,8 @@ ADD build/distributions/controller.tar /
COPY init.sh /
RUN chmod +x init.sh

RUN adduser -D -u ${UID} -h /home/${NOT_ROOT_USER} -s /bin/bash ${NOT_ROOT_USER}
USER ${NOT_ROOT_USER}

EXPOSE 8080
CMD ["./init.sh", "0"]

0 comments on commit 884bb91

Please sign in to comment.