简体   繁体   中英

Jenkins and SonarQube in same dockerfile

How to create Docker image which contains jenkins and sonarqube in same container. I have a dockerfile for jenkins.

FROM jenkins
USER root
RUN apt-get update \
      && apt-get install -y sudo \
      && rm -rf /var/lib/apt/lists/*
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
USER jenkins
COPY hudson.plugins.msbuild.MsBuildBuilder.xml /var/jenkins_home
COPY hudson.plugins.sonar.SonarPublisher.xml /var/jenkins_home
COPY hudson.plugins.sonar.SonarRunnerInstallation.xml /var/jenkins_home
COPY org.jenkinsci.plugins.MsTestBuilder.xml /var/jenkins_home
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

How to add sonarqube with this dockerfile.

You should really only run a single process in a single container (see https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/ for learning on docker best practises). Instead use the docker-compose tool to start up your separate docker containers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM