Jenkins configuration jdk and maven, is to install in the container itself?

Dockerhub pull down the jenkins, after the start to configure jdk and maven, need to install their own in the container? 2016-01-27 add comment share it

  • Weibo
  • QZONE
  • Micro letter

Did not find the relevant results

    Invited:

    Akirapanda – former bank clearing compliance, now wild programmer

    We agreed from:


    Jenkins theory is a CI's scheduling framework, which itself is a master-slave structure. The best practice is to try not to build the master node, that is, jenkins' docker container.
    You can use compose to jenkins deployment alone only jdk & maven docker container to do the construction of the slave node.

    Of course, if you have to worry about trouble, to rewrite the original jenkins master node to build no problem.
    Dockerflle as follows

     FROM jenkins 
    USER root
    ENV MAVEN_VERSION 3.3.9
    RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C / usr / share \
    && mv / usr / share / apache-maven- $ MAVEN_VERSION / usr / share / maven \
    && ln -s / usr / share / maven / bin / mvn / usr / bin / mvn

    ENV MAVEN_HOME / usr / share / maven
    VOLUME /root/.m2

    Heads up! This alert needs your attention, but it's not super important.