如何在同一个容器中创建包含jenkins和sonarqube的Docker镜像。我有一个jenkins的dockerfile。
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
如何使用此dockerfile添加sonarqube。
答案 0 :(得分:0)
您应该只在一个容器中运行一个进程(有关docker最佳实践的了解,请参阅https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/)。而是使用docker-compose工具启动单独的docker容器。