Сбой установки плагинов в образе докера jenkins - PullRequest
5 голосов
/ 29 октября 2019

У меня есть Dockerfile для пользовательского мастера Jenkins, например:

FROM jenkins/jenkins:lts
USER root
ENV http_proxy http://xx.xx.xx.xx:8080
ENV https_proxy http://xx.xx.xx.xx:8080
RUN apt-get update
RUN apt-get install -y --allow-unauthenticated ldap-utils curl wget vim nano sudo git
RUN adduser jenkins sudo
User jenkins
ENV http_proxy http://xx.xx.xx.xx:8080
ENV https_proxy http://xx.xx.xx.xx:8080
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN  /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
RUN echo 2.176.2 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
RUN echo 2.176.2 > /usr/share/jenkins/ref/jenkins.install.InstallUtil.lastExecVersion
EXPOSE 9081
EXPOSE 50000

Я ожидал, что плагины будут установлены во время команды сборки Docker docker build --no-cache -t jenkins .

Но плагины установки.sh не удается установить плагины

-max-time 60 https://updates.jenkins.io/download/plugins/structs-plugin/1.5/structs-plugin.hpi -o /usr/share/jenkins/ref/plugins/structs-plugin.jpi)
Failed to download plugin: structs or structs-plugin
curl: (22) The requested URL returned error: 403 Forbidden
14:21:00 Failure (22) Retrying in 1 seconds...
14:21:01 Failed in the last attempt (curl -sSfL --connect-timeout 20 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/download/plugins/github-branch-source/1.10/github-branch-source.hpi -o /usr/share/jenkins/ref/plugins/github-branch-source.jpi)
Downloading plugin: github-branch-source-plugin from https://updates.jenkins.io/download/plugins/github-branch-source-plugin/1.10/github-branch-source-plugin.hpi
14:21:01 Failed in the last attempt (curl -sSfL --connect-timeout 20 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/download/plugins/dashboard-view/2.9.10/dashboard-view.hpi -o /usr/share/jenkins/ref/plugins/dashboard-view.jpi)
Downloading plugin: dashboard-view-plugin from https://updates.jenkins.io/download/plugins/dashboard-view-plugin/2.9.10/dashboard-view-plugin.hpi
curl: (22) The requested URL returned error: 403 Forbidden
14:21:01 Failure (22) Retrying in 1 seconds...
14:21:01 Failed in the last attempt (curl -sSfL --connect-timeout 20 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/download/plugins/statusmonitor/1.3/statusmonitor.hpi -o /usr/share/jenkins/ref/plugins/statusmonitor.jpi)
Downloading plugin: statusmonitor-plugin from https://updates.jenkins.io/download/plugins/statusmonitor-plugin/1.3/statusmonitor-plugin.hpi
14:21:01 Failed in the last attempt (curl -sSfL --connect-timeout 20 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/download/plugins/ssh-agent/1.8/ssh-agent.hpi -o /usr/share/jenkins/ref/plugins/ssh-agent.jpi)

1 Ответ

3 голосов
/ 12 ноября 2019

Я использовал ваш Dockerfile для создания образа без прокси, и он отлично работает. Я использовал некоторые плагины, написанные в вашем выводе. Итак, ваш Dockerfile в порядке, это может быть проблема с прокси.

Это можно легко оценить. Попробуйте создать это / другое изображение при загрузке плагина с / без прокси.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...