Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47918

Installing plugins with install-plugins.sh to docker image created from jenkinsci/blueocean fails

    Details

    • Sprint:
      Blue Ocean 1.4 - beta 3
    • Similar Issues:

      Description

      With the following Dockerfile, I get error:

      Creating initial locks...
      mkdir: cannot create directory ‘/usr/share/jenkins/ref/plugins/xunit.lock’: Permission denied

      Note: This error does not occur with jenkins/jenkins:lts

       


      FROM jenkinsci/blueocean:latest

      VOLUME /var/jenkins_home

      RUN /usr/local/bin/install-plugins.sh xunit

      ENTRYPOINT /usr/local/bin/jenkins.sh --httpPort=8080

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Yoann Dubreuil any idea whats going on here?

            Show
            jamesdumay James Dumay added a comment - Yoann Dubreuil any idea whats going on here?
            Hide
            ydubreuil Yoann Dubreuil added a comment - - edited

            /usr/local/bin/install-plugins.sh needs to run as root, I think. You need to switch to root and then back to jenkins like it's done in https://github.com/jenkinsci/blueocean-plugin/blob/master/Dockerfile

            Applied here, this would give:

            FROM jenkinsci/blueocean:latestUSER root

            RUN /usr/local/bin/install-plugins.sh xunit

            USER jenkins

            VOLUME /var/jenkins_home

            ENTRYPOINT /usr/local/bin/jenkins.sh --httpPort=8080

            I'd also move VOLUME step behind install-plugin.sh. Plugins are not install in JENKINS_HOME but in the reference volume located under /usr/share/jenkins/ref/plugins/

            Show
            ydubreuil Yoann Dubreuil added a comment - - edited /usr/local/bin/install-plugins.sh needs to run as root , I think. You need to switch to root and then back to  jenkins like it's done in https://github.com/jenkinsci/blueocean-plugin/blob/master/Dockerfile Applied here, this would give: FROM jenkinsci/blueocean:latest USER root RUN /usr/local/bin/install-plugins.sh xunit USER jenkins VOLUME /var/jenkins_home ENTRYPOINT /usr/local/bin/jenkins.sh --httpPort=8080 I'd also move VOLUME step behind install-plugin.sh . Plugins are not install in JENKINS_HOME but in the reference volume located under /usr/share/jenkins/ref/plugins/
            Hide
            ndeloof Nicolas De Loof added a comment - - edited

            install-plugin should NOT run as root.

            The issue is due to blueocean Dockerfile to run it as root and as such create "plugins" folder with root as owner and jenkins user can't write there.

            see https://github.com/jenkinsci/blueocean-plugin/pull/1568

             

            Show
            ndeloof Nicolas De Loof added a comment - - edited install-plugin should NOT run as root. The issue is due to blueocean Dockerfile to run it as root and as such create "plugins" folder with root as owner and jenkins user can't write there. see  https://github.com/jenkinsci/blueocean-plugin/pull/1568  
            Hide
            jamesdumay James Dumay added a comment -

            Thanks for looking into this Nicolas De Loof and Yoann Dubreuil

            Show
            jamesdumay James Dumay added a comment - Thanks for looking into this Nicolas De Loof and Yoann Dubreuil

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                realtieho Teijo Hakala
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: