Add example Dockerfile
Some checks failed
Build and Push Docker Image / build (push) Failing after 12s
Build / Build and analyze (push) Failing after 7s

This commit is contained in:
2025-12-17 17:17:32 -05:00
parent 09a4c16102
commit 4d6d16f0da

View File

@@ -0,0 +1,31 @@
FROM jenkins/inbound-agent:alpine AS jnlp
FROM python:3.13.2-alpine
# USER jenkins
RUN apk --no-cache -U add openjdk17-jre python3 postgresql-client git python3-dev openssh mysql-client build-base curl \
&& apk cache clean
RUN python3 -m ensurepip \
&& pip3 install --no-cache-dir --upgrade pip setuptools
# USER root
# ADD ca-chain.der .
# RUN $JAVA_HOME/bin/keytool -noprompt -alias local-CA \
# -keystore "$JAVA_HOME/jre/lib/security/cacerts" \
# -import -file ca-chain.der \
# -storepass changeit
# USER jenkins
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
RUN mkdir "$HOME/.ssh/" \
&& touch "$HOME/.ssh/known_hosts" \
&& ssh-keyscan github.com >> ~/.ssh/known_hosts
# COPY ca-chain.crt "$JAVA_HOME/jre/lib/security"
# RUN cd "$JAVA_HOME/jre/lib/security" \
# && keytool -import -alias homeca -storepass changeit -noprompt -trustcacerts -keystore cacerts -file ca-chain.crt
ENTRYPOINT ["/usr/local/bin/jenkins-agent"]