OWASP / SecurityShepherd

Web and mobile application security training platform
https://owasp.org/www-project-security-shepherd/
GNU General Public License v3.0
1.35k stars 460 forks source link

[BUG] Building Web Container Image fails: "Can't rename file ... server.xml ... Invalid argument #753

Open mmhdbw opened 1 year ago

mmhdbw commented 1 year ago

Describe the bug When I try to install SecurityShepherd, docker build phase fails:

 $ docker compose up
...
 => [stage-1  8/13] RUN apt-get -qq update && apt-get install -y patch libargon2-0             8.2s
 => [stage-1  9/13] RUN adduser --system --group tomcat --home /usr/local/tomcat               5.6s
 => [stage-1 10/13] RUN chown -R tomcat:${RUN_GROUP} /usr/local/tomcat                         8.2s
 => [stage-1 11/13] RUN rm -rf /usr/local/tomcat/webapps/ROOT                                  3.2s
 => ERROR [stage-1 12/13] RUN patch /usr/local/tomcat/conf/server.xml /usr/local/tomcat/conf/  0.4s
------
 > [stage-1 12/13] RUN patch /usr/local/tomcat/conf/server.xml /usr/local/tomcat/conf/serverxml.patch:
#0 0.350 patching file /usr/local/tomcat/conf/server.xml
#0 0.353 Hunk #2 succeeded at 109 (offset -1 lines).
#0 0.361 patch: **** Can't rename file /usr/local/tomcat/conf/server.xml to /usr/local/tomcat/conf/server.xml.orig : Invalid argument
------
failed to solve: process "/bin/sh -c patch /usr/local/tomcat/conf/server.xml /usr/local/tomcat/conf/serverxml.patch" did not complete successfully: exit code: 2 

To Reproduce Steps to reproduce the behavior: (following the instructions in https://github.com/OWASP/SecurityShepherd/wiki/Docker-Environment-Setup)

  1. Login to fresh and up-to-date Ubuntu 22.04 system with Docker and docker-compose preinstalled; user is already member of docker group
  2. sudo apt install git maven openjdk-8-jdk
  3. git clone https://github.com/OWASP/SecurityShepherd.git
  4. cd SecurityShepherd
  5. mvn -Pdocker clean install -DskipTests
  6. docker compose up
  7. See error above

Expected behavior The docker compose up should not fail but successfully start up docker containers.

Desktop (please complete the following information):

Further Information:

Screenshots none, just see excerpt from build above

Additional context Add any other context about the problem here.