Skip to content

Commit

Permalink
WebGoat no longer runs as root in the Docker container.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaars committed Jul 26, 2017
1 parent b06fb72 commit 0b92a57
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions webgoat-server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM openjdk:8-jre
VOLUME /tmp
RUN cd /root; mkdir -p .webgoat
ADD webgoat-server-8.0-SNAPSHOT.jar webgoat.jar
RUN sh -c 'touch /webgoat.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/webgoat.jar"]

RUN useradd --home-dir /home/webgoat --create-home -U webgoat

USER webgoat
RUN cd /home/webgoat/; mkdir -p .webgoat
COPY webgoat-server-8.0-SNAPSHOT.jar /home/webgoat/webgoat.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/home/webgoat/webgoat.jar"]

0 comments on commit 0b92a57

Please sign in to comment.