commit a6287ae96eeaab8b97efd691192146c85d7d8996
parent 5a3911c854581576ad5543a5dfb7ae38873cf010
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Sun, 3 Aug 2025 20:00:33 +0200
feat(jenkins-agent): bump alpine/java versions
Diffstat:
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/docker/docker-jenkins-inbound-agent/Dockerfile b/docker/docker-jenkins-inbound-agent/Dockerfile
@@ -19,31 +19,18 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-ARG ALPINE_TAG=3.20.0
-FROM alpine:"${ALPINE_TAG}" AS jre-build
+ARG ALPINE_TAG=3.22.1
+FROM docker.io/alpine:"${ALPINE_TAG}" AS jre-build
-SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
-
-# This Build ARG is populated by Docker
-# Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
-ARG TARGETPLATFORM
-
-COPY adoptium-get-jdk-link.sh /usr/bin/local/adoptium-get-jdk-link.sh
-COPY adoptium-install-jdk.sh /usr/bin/local/adoptium-install-jdk.sh
-
-ARG JAVA_VERSION=17.0.11_9
-# hadolint ignore=DL3018
-RUN apk add --no-cache \
- ca-certificates \
- jq \
- curl \
- && /usr/bin/local/adoptium-install-jdk.sh alpine
-
-ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"
+ARG JAVA_VERSION="24.0.2"
+ARG DOWNLOAD_URL="https://download.java.net/java/GA/jdk${JAVA_VERSION}/fdc5d0102fe0414db21410ad5834341f/12/GPL/openjdk-${JAVA_VERSION}_linux-aarch64_bin.tar.gz"
+RUN wget -q -O /tmp/jdk.tar.gz "${DOWNLOAD_URL}"
+RUN tar -xzf /tmp/jdk.tar.gz -C /opt/
## Agent image target
-FROM alpine:"${ALPINE_TAG}" AS agent
+FROM docker.io/alpine:"${ALPINE_TAG}" AS agent
+ARG JAVA_VERSION="24.0.2"
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
@@ -57,8 +44,6 @@ ARG AGENT_WORKDIR=/home/"${user}"/agent
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
ENV TZ=Etc/UTC
-## Always use the latest Alpine packages: no need for versions
-# hadolint ignore=DL3018
RUN apk add --no-cache \
curl \
bash \
@@ -72,14 +57,15 @@ RUN apk add --no-cache \
tzdata-utils \
&& rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/*
-ARG VERSION=3248.v65ecb_254c298
+# Download Jenkins remoting agent
+ARG VERSION=3327.v868139a_d00e0
ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" /usr/share/jenkins/agent.jar
RUN chmod 0644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=jre-build /opt/jdk-21.0.3_9 "$JAVA_HOME"
+ENV JAVA_HOME="/opt/java/openjdk/${JAVA_VERSION}"
+COPY --from=jre-build "/opt/jdk-${JAVA_VERSION}" "$JAVA_HOME"
ENV PATH="${JAVA_HOME}/bin:${PATH}"
USER "${user}"
@@ -105,13 +91,10 @@ FROM agent AS inbound-agent
ARG user=jenkins
USER root
-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
# Install Docker client
-ARG DOCKER_VERSION=26.0.2
-ARG DOCKER_COMPOSE_VERSION=v2.27.0
+ARG DOCKER_VERSION=28.3.3
+ARG DOCKER_COMPOSE_VERSION=v2.39.1
RUN curl -fsSL https://download.docker.com/linux/static/stable/armhf/docker-$DOCKER_VERSION.tgz | tar --strip-components=1 -xz -C /usr/local/bin docker/docker
RUN curl -fsSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-armv7 > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
@@ -153,4 +136,4 @@ LABEL \
org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \
org.opencontainers.image.licenses="MIT"
-ENTRYPOINT ["/usr/local/bin/jenkins-agent"]
+CMD ["java", "-jar", "/usr/share/jenkins/agent.jar"]