jenkinsci / jenkinsfile-runner

A command line tool to run Jenkinsfile as a function
MIT License
1.13k stars 291 forks source link

Unable to install plugins in Docker image (Error: Unable to get Jenkins version from the WAR file /app/jenkins/jenkins.war) #599

Open nicl-dev opened 2 years ago

nicl-dev commented 2 years ago

Jenkins and plugins versions report

Environment ```text Default jenkinsfile-runner image ```

What Operating System are you using (both controller, and any agents involved in the problem)?

WSL2 + Docker

Reproduction steps

  1. https://github.com/jenkinsci/jenkinsfile-runner/blob/master/docs/using/EXTENDING_DOCKER.adoc#installing-plugins

Expected Results

New image with slack plugin installed.

Actual Results

[+] Building 0.9s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                          0.0s
 => => transferring dockerfile: 38B                                                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/jenkins/jenkinsfile-runner:latest                                                                                                                                  0.0s
 => [internal] load build context                                                                                                                                                                             0.0s
 => => transferring context: 32B                                                                                                                                                                              0.0s
 => [1/4] FROM docker.io/jenkins/jenkinsfile-runner                                                                                                                                                           0.0s
 => CACHED [2/4] COPY plugins.txt /usr/share/jenkins/ref/plugins.txt                                                                                                                                          0.0s
 => CACHED [3/4] RUN cd /app/jenkins && jar -cvf jenkins.war *                                                                                                                                                0.0s
 => ERROR [4/4] RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war                              0.8s
------
 > [4/4] RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war:
#6 0.399 Unable to get Jenkins version from the WAR file /app/jenkins/jenkins.war
#6 0.810 Error getting update center json
------
executor failed running [/bin/sh -c java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt && rm /app/jenkins/jenkins.war]: exit code: 1
nicl-dev commented 2 years ago

Okay, this seems to be a duplicate of #590. Hope it gets fixed soon because now I'm really struggling to find an easy alternative for plugin + configuration extension. The nested documentation is really confusing to me.