ARG JENKINS_VERSION=lts-jdk11
FROM jenkins/jenkins:${JENKINS_VERSION}
COPY docker_files/jenkins-log.properties /etc/jenkins-log.properties
USER root
RUN apt-get update && apt-get install -y \
ca-certificates curl gnupg2 \
software-properties-common && \
mkdir -p /data1/jenkins /var/cache/jenkins/war && chown -R jenkins:jenkins /data1/jenkins /var/cache/jenkins
USER jenkins
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false -Duser.home=/data1/jenkins -Djenkins.model.Jenkins.slaveAgentPort=50000 -Djava.util.logging.config.file=/etc/jenkins-log.properties" \
JENKINS_HOME="/data1/jenkins" \
JENKINS_OPTS="--webroot=/var/cache/jenkins/war --httpPort=8081" \
JENKINS_SLAVE_AGENT_PORT="50000"
EXPOSE 8081
RUN jenkins-plugin-cli --latest false --plugins " \
ansicolor:1.0.1 \
ant:1.11 \
antisamy-markup-formatter:2.1 \
"
将导致以下错误'无法解析插件URL https://updates.jenkins.io/latest/.hpi,或无法将插件下载到文件:状态代码:404,原因短语:找不到从镜像下载失败,正在回退到https://archives.jenkins.io/无法解析插件URL https://archives.jenkins.io/plugins/latest/.hpi,或将插件下载到文件:状态代码:404,原因短语:未找到',,,
有什么帮助吗?
1条答案
按热度按时间uttx8gqw1#
jenkins-plugin-cli命令对于空格非常严格。我在尝试使用新行来保持插件列表可读时遇到了同样的问题。这在我的Dockerfiles中有效
或者,可以使用文本文件,类似于旧插件安装程序脚本的使用方式
https://github.com/jenkinsci/docker/#preinstalling-plugins