Skip to content

Commit

Permalink
Merge pull request #2 from cloudbees-oss/use-jenkins-base-image
Browse files Browse the repository at this point in the history
[FNDJEN-1482] - Use Jenkins base image to avoid workaround for Docker packaging limitations
  • Loading branch information
oleg-nenashev authored Aug 6, 2019
2 parents badb94e + 5a9dada commit 696ff3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 211 deletions.
31 changes: 9 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
FROM jenkins/jenkins:2.176.2 as install_scripts_source
FROM cloudbees/cloudbees-jenkins-distribution:2.176.2.3 as war_source

FROM cloudbees/cloudbees-jenkins-distribution:2.176.2.3
COPY --from=install_scripts_source /usr/local/bin/jenkins-support /usr/local/bin/jenkins-support
COPY --from=install_scripts_source /usr/local/bin/install-plugins.sh /usr/local/bin/install-plugins.sh
FROM jenkins/jenkins:2.176.2

ENV JENKINS_UC http://jenkins-updates.cloudbees.com
ENV JENKINS_INCREMENTALS_REPO_MIRROR https://repo.jenkins-ci.org/incrementals

# Workaround https://github.com/jenkinsci/docker/issues/857
USER root
RUN mkdir -p /usr/share/jenkins/ && ln -s /usr/share/cloudbees-jenkins-distribution/cloudbees-jenkins-distribution.war /usr/share/jenkins/jenkins.war
USER cloudbees-jenkins-distribution
# Replace jenkins.war by CloudBees Jenkins Distribution WAR which includes plugins from CloudBees Assurance Program and other features
COPY --from=war_source /usr/share/cloudbees-jenkins-distribution/cloudbees-jenkins-distribution.war /usr/share/jenkins/jenkins.war

# Startup all plugins included into the CloudBees Jenkins Distribution bundle
ENV JAVA_OPTS "-Dcom.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.allRequired=true"

# Install extra plugins
# REF_ROOT is consumed by jenkins-support in the https://github.com/jenkinsci/docker/issues/861 workaround
ENV REF_ROOT=/usr/share/cloudbees-jenkins-distribution/ref
ENV REF=${REF_ROOT}/plugins
COPY plugins.txt /usr/share/cloudbees-jenkins-distribution/ref/plugins.txt
RUN bash /usr/local/bin/install-plugins.sh < /usr/share/cloudbees-jenkins-distribution/ref/plugins.txt
# Install additional plugins including JCasC
ENV JENKINS_UC http://jenkins-updates.cloudbees.com
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN bash /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

# Apply JCasC
# Apply JCasC configuration
COPY jenkins.yaml /cfg/jenkins.yaml
ENV CASC_JENKINS_CONFIG /cfg/jenkins.yaml

# Temporary override for jenkins-support to support custom ref-roots there
# TODO: remove once https://github.com/jenkinsci/docker/issues/861 is fixed
COPY jenkins-support /usr/local/bin/jenkins-support
189 changes: 0 additions & 189 deletions jenkins-support

This file was deleted.

0 comments on commit 696ff3c

Please sign in to comment.