gpt4 book ai didi

jenkins - 在 Docker 插件中构建 Jenkins 时安装失败

转载 作者:行者123 更新时间:2023-12-02 17:24:08 25 4
gpt4 key购买 nike

我有一个自定义 Jenkins 主控的 Dockerfile,如下所示:

FROM jenkins
MAINTAINER me

USER root

RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state

RUN apt-get update \
&& apt-get install -y sudo \
&& apt-get install -y vim \
&& rm -rf /var/lib/apt/lists/*
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers

USER jenkins

# COPY plugins.txt /usr/share/jenkins/plugins.txt
# RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
ENV JAVA_OPTS="-Xmx8192m"
ENV JENKINS_OPTS="--handlerCountStartup=100 --handlerCountMax=300"


RUN /usr/local/bin/install-plugins.sh git:2.6.0

一切正常,直到 RUN /usr/local/bin/install-plugins.sh git:2.6.0线。安装插件时出现错误:
Creating initial locks...

Analyzing war...

Downloading plugins...
Downloading plugin: git from https://updates.jenkins.io/download/plugins/git/2.6.0/git.hpi
Downloading plugin: git-plugin from https://updates.jenkins.io/download/plugins/git-plugin/2.6.0/git-plugin.hpi
Failed to download plugin: git or git-plugin

WAR bundled plugins:


Installed plugins:
*:

Some plugins failed to download!
Not downloaded: git
The command '/bin/sh -c /usr/local/bin/install-plugins.sh git:2.6.0' returned a non-zero code: 1

我做错了什么还是 Jenkins/Docker 有问题?

最佳答案

您的 Dockerfile 对我有用,安装了所有插件并成功构建了镜像:

Analyzing war... 
Downloading plugins...
Downloading plugin: git from https://updates.jenkins.io/download/plugins/git/2.6.0/git.hpi
> git depends on workflow-scm-step:1.14.2,mailer:1.17,matrix-project:1.7.1,ssh-credentials:1.12,parameterized-trigger:2.4;resolution:=optional,scm-api:1.2,token-macro:1.11;resolution:=optional,promoted-builds:2.27;resolution:=optional,credentials:2.1.4,git-client:1.21.0

Downloading plugin: workflow-scm-step from https://updates.jenkins.io/download/plugins/workflow-scm-step/latest/workflow-scm-step.hpi
...
Removing intermediate container 4f895c203944
Successfully built 31d58d1f586f

试试 docker build --no-cache如果图像缓存中的某个图层出现问题,或设置 automated build on Docker Hub并在 Docker 的服务器上构建它。

关于jenkins - 在 Docker 插件中构建 Jenkins 时安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39782949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com