Skip to content

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

@mmhdbw

Description

@mmhdbw

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):

  • OS: Ubuntu 22.04.2 LTS
  • Browser: none; just a headless box that we entered with ssh

Further Information:

  • mvn version: 3.6.3-5
  • docker version: 23.0.1, built Thu Feb 9 19:47:01 2023, Git commit a5ee5b1
  • docker-compose version: v2.16.0 (compose as plugin)
  • java version: openjdk 11.0.18 2023-01-17

Screenshots
none, just see excerpt from build above

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions