我正在构建一个构建Jenkins的映像,我尝试在Jenkins运行时使用插件,所以,我需要在我的插件执行之前运行Jenkins。
我像docker build -t dockerfile一样执行它,并获得了错误:
jenkins.JenkinsException:请求出错:[Errno 99]
无法分配请求的地址
我认为问题是当插件执行时,它猜测Jenkins正在运行而不是。
FROM foxylion/jenkins
MAINTAINER Mishel Uchuari <dmuchuari@hotmail.com>
RUN /usr/local/bin/install-plugins.sh workflow-remote-loader workflow-aggregator build-pipeline-plugin
ENV JENKINS_USER replicate
ENV JENKINS_PASS replicate
USER root
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get install -y apt-utils
RUN apt-get install -y python-pip
RUN apt install -y linuxbrew-wrapper
RUN useradd someuser -m -s /bin/bash
USER someuser
RUN chmod -R 777 /home/someuser
RUN brew install libyaml
USER root
RUN apt-get install build-essential
RUN apt-get -y update && apt-get -y upgrade
RUN pip install jenkins-job-builder==2.0.0.0b2
RUN pip install PyYAML python-jenkins
RUN mkdir /etc/jenkins_jobs/
COPY jenkins_jobs.ini /etc/jenkins_jobs/
COPY scm_pipeline.yaml /etc/jenkins_jobs/
RUN jenkins-jobs --conf /etc/jenkins_jobs/jenkins_jobs.ini update /etc/jenkins_jobs/scm_pipeline.yaml
1条答案
按热度按时间oxalkeyp1#
我在Docker下使用它时遇到了同样的问题:
文件“/src/。tox/py27/local/lib/python2.7/site-packages/jenkins_jobs/ www.example.com ”,第124行,在get_plugins_info中引起JenkinsException:请求出错:[错误99]无法分配请求的地址
这是当它试图检索插件列表时引起的,我去重写
plugins_info
以缩短代码路径:我在Python 2上遇到了问题。Debian杰西上的7.9如果我没记错的话,这在后来的python版本(eg 2)中就不再是问题了。7.13来自Debian Stretch。
(the我遇到问题的补丁): www.example.com
RUN brew install libyaml
brew
是Mac OS X的软件包管理器。当lib不可用时,PyYAML也会优雅地跳过编译。所以你可能不需要那一个。而且我猜不安装build-essential
也能工作。RUN pip install jenkins-job-builder==2.0.0.0b2 RUN pip install PyYAML python-jenkins
我很惊讶你已经显式安装了PyYAML和python-jenkins。假设安装jenkins-job-builder应该安装所有依赖项(例如PyYAML和python-jenkins)。