代码拉取完成,页面将自动刷新
FROM openeuler/openeuler:22.09
COPY . /root/tool-collections
ENV GOROOT=/usr/local/go
ENV PATH=$PATH:$GOROOT/bin
ENV GOPATH=/go
ENV LANG=en_US.UTF-8
RUN cp /usr/bin/python3 /usr/bin/python
RUN yum update && \
yum install -y wget tar git vim subversion python3-pip java-11-openjdk-devel sudo ruby && \
pip3 install requests python-jenkins PyYAML pandas openpyxl xlsx2html codespell && \
wget -O go.tar.gz https://golang.org/dl/go1.12.1.linux-amd64.tar.gz && \
tar -C /usr/local -zxf go.tar.gz && \
rm -f go.tar.gz
RUN cd /root/tool-collections/ && GOFLAGS=-mod=vendor go build -o validator ./cmd/tools && cp validator /usr/bin
RUN gem install mdl
# Setup java path
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
ENV PATH $PATH:$JAVA_HOME/bin
# Install jenkins slave
ARG VERSION=4.2.1
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group}
RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user}
ARG AGENT_WORKDIR=/home/${user}/agent
RUN mkdir -p /usr/share/jenkins/
COPY agent.jar /usr/share/jenkins/
RUN cd /usr/share/jenkins/ \
&& wget -O agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \
&& chmod 755 /usr/share/jenkins \
&& chmod 644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar
# Install jnlp
COPY jenkins-agent /usr/local/bin/jenkins-agent
RUN chmod +x /usr/local/bin/jenkins-agent &&\
ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN mkdir /home/infra_check
# Add validator
RUN cp /usr/bin/validator /home/infra_check
# Setting up env
USER ${user}
ENV AGENT_WORKDIR=${AGENT_WORKDIR}
RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR}
VOLUME /home/${user}/.jenkins
VOLUME ${AGENT_WORKDIR}
WORKDIR /home/${user}
ENTRYPOINT ["/tini", "--", "jenkins-agent"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。