christophetd / log4shell-vulnerable-app

Spring Boot web application vulnerable to Log4Shell (CVE-2021-44228).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker build problem

mhagnumdw opened this issue · comments

Command

docker build . -t vulnerable-app

Problem

Step 8/9 : COPY --from=builder /home/gradle/src/build/libs/*.jar /app/spring-boot-application.jar
When using COPY with more than one source file, the destination must be a directory and end with a /

Inside libs folder are two jars:

  • log4shell-vulnerable-app-0.0.1-SNAPSHOT.jar
  • log4shell-vulnerable-app-0.0.1-SNAPSHOT-plain.jar

Thanks for reporting! I can't reproduce the issue, which version of docker are you using?

$ docker version
Client: Docker Engine - Community
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        48d30b5
 Built:             Fri Jan 29 14:34:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       46229ca
  Built:            Fri Jan 29 14:32:09 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

DIdn't manage to reproduce neither with Docker Desktop on Mac OS neither with Docker on Ubuntu. Can you try running manually:

rm build/libs/*.jar
./gradlew clean bootJar

And show what you have in build/libs?

Thank you for your attention.

It was some mess that had left the log4shell-vulnerable-app-0.0.1-SNAPSHOT-plain.jar file inside build/libs and there were two jars in the folder. After a ./gradlew clean, only the log4shell-vulnerable-app-0.0.1-SNAPSHOT.jar file was generated and everything started working again.