Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python agent #15

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Jenkinsfile_k8s
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ parallel(
dockerfile: 'node/Dockerfile',
])
},
'python': {
buildDockerAndPublishImage('inbound-agent-python', [
mainBranch: principalBranch,
dockerfile: 'python/Dockerfile',
])
},
'ruby': {
buildDockerAndPublishImage('inbound-agent-ruby', [
mainBranch: principalBranch,
Expand Down
31 changes: 31 additions & 0 deletions python/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use Debian base
FROM jenkins/inbound-agent:jdk11 as jnlp

FROM python:3-bullseye

## Ignore apt package pinning as we always want the latest package here
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
git \
libfontconfig1 \
libfreetype6 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install JDK from the official agent image
ENV JAVA_HOME=/opt/jdk-11
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jnlp /opt/java/openjdk "${JAVA_HOME}"

COPY --from=jnlp /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-agent
COPY --from=jnlp /usr/share/jenkins/agent.jar /usr/share/jenkins/agent.jar

ENTRYPOINT ["/usr/local/bin/jenkins-agent"]

ARG user=jenkins
RUN useradd -c "Jenkins user" -m ${user} \
&& chmod 750 /home/${user}
USER ${user}