From 4869616176c327c90116e2fc300a0cb8fa0cc557 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Thu, 22 Apr 2021 16:44:12 +0200 Subject: [PATCH] Simplify Docker image with regards to creating the webgoat user --- docker/Dockerfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b16e71d4d..4b1c0eaba 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,20 +3,17 @@ FROM openjdk:15.0.2-slim ARG webgoat_version=8.2.0-SNAPSHOT ENV webgoat_version_env=${webgoat_version} -RUN apt-get update && apt-get install -RUN useradd --home-dir /home/webgoat --create-home -U webgoat -RUN cd /home/webgoat/; -RUN chgrp -R 0 /home/webgoat -RUN chmod -R g=u /home/webgoat +RUN apt-get update +RUN useradd -ms /bin/bash webgoat RUN apt-get -y install apt-utils nginx USER webgoat -COPY nginx.conf /etc/nginx/nginx.conf -COPY index.html /usr/share/nginx/html/ -COPY target/webgoat-server-${webgoat_version}.jar /home/webgoat/webgoat.jar -COPY target/webwolf-${webgoat_version}.jar /home/webgoat/webwolf.jar -COPY start.sh /home/webgoat +COPY --chown=webgoat nginx.conf /etc/nginx/nginx.conf +COPY --chown=webgoat index.html /usr/share/nginx/html/ +COPY --chown=webgoat target/webgoat-server-${webgoat_version}.jar /home/webgoat/webgoat.jar +COPY --chown=webgoat target/webwolf-${webgoat_version}.jar /home/webgoat/webwolf.jar +COPY --chown=webgoat start.sh /home/webgoat EXPOSE 8080 EXPOSE 9090