Skip to content
Draft
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
9 changes: 8 additions & 1 deletion alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ RUN case "$(jlink --version 2>&1)" in \
## Agent image target
FROM alpine:"${ALPINE_TAG}" AS agent

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
Expand All @@ -77,7 +79,6 @@ RUN apk add --no-cache \
curl \
bash \
git \
git-lfs \
musl-locales \
openssh-client \
openssl \
Expand All @@ -91,6 +92,12 @@ ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins
RUN chmod 0644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar

ARG GIT_LFS_VERSION=3.7.0
RUN arch=$(uname -m | sed -e 's/x86_64/amd64/g' -e 's/aarch64/arm64/g') \
&& curl -L -s -o git-lfs.tgz "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${arch}-v${GIT_LFS_VERSION}.tar.gz" \
&& tar xzf git-lfs.tgz \
&& bash git-lfs-*/install.sh \
&& rm -rf git-lfs*

ENV JAVA_HOME=/opt/java/openjdk
COPY --from=jre-build /javaruntime "$JAVA_HOME"
Expand Down
10 changes: 9 additions & 1 deletion debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ RUN if [[ "${TARGETPLATFORM}" != "linux/arm/v7" ]]; then \
## Agent image target
FROM debian:"${DEBIAN_RELEASE}"-slim AS agent

SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
Expand All @@ -87,7 +89,6 @@ RUN apt-get update \
curl \
fontconfig \
git \
git-lfs \
less \
netbase \
openssh-client \
Expand All @@ -101,6 +102,13 @@ ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins
RUN chmod 0644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar

ARG GIT_LFS_VERSION=3.7.0
RUN arch=$(uname -m | sed -e 's/x86_64/amd64/g' -e 's/aarch64/arm64/g') \
&& curl -L -s -o git-lfs.tgz "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${arch}-v${GIT_LFS_VERSION}.tar.gz" \
&& tar xzf git-lfs.tgz \
&& bash git-lfs-*/install.sh \
&& rm -rf git-lfs*

ENV LANG=C.UTF-8

ENV JAVA_HOME=/opt/java/openjdk
Expand Down
10 changes: 9 additions & 1 deletion rhel/ubi9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ RUN case "$(jlink --version 2>&1)" in \

FROM registry.access.redhat.com/ubi9/ubi:"${UBI9_TAG}" AS agent

SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
Expand All @@ -54,7 +56,6 @@ RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps=
ca-certificates \
fontconfig \
git \
git-lfs \
less \
patch \
tzdata \
Expand All @@ -65,6 +66,13 @@ ADD --chown="${user}":"${group}" "https://repo.jenkins-ci.org/public/org/jenkins
RUN chmod 0644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar

ARG GIT_LFS_VERSION=3.7.0
RUN arch=$(uname -m | sed -e 's/x86_64/amd64/g' -e 's/aarch64/arm64/g') \
&& curl -L -s -o git-lfs.tgz "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${arch}-v${GIT_LFS_VERSION}.tar.gz" \
&& tar xzf git-lfs.tgz \
&& bash git-lfs-*/install.sh \
&& rm -rf git-lfs*

ENV LANG=C.UTF-8

ENV JAVA_HOME=/opt/java/openjdk
Expand Down
9 changes: 8 additions & 1 deletion tests/tests_agent.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SUT_IMAGE=$(get_sut_image)

ARCH=${ARCH:-x86_64}

GIT_LFS_VERSION='3.7.0'

@test "[${SUT_IMAGE}] test version in docker metadata" {
local expected_version
expected_version=$(get_remoting_version)
Expand All @@ -32,7 +34,7 @@ ARCH=${ARCH:-x86_64}
assert_equal "${output}" "UTF-8"
}

@test "[${SUT_IMAGE}] image has bash, curl, ssh and java installed and in the PATH" {
@test "[${SUT_IMAGE}] image has bash, curl, ssh, java and git-lfs (and thus git) installed and in the PATH" {
local cid
cid="$(docker run -d -it -P "${SUT_IMAGE}" /bin/bash)"

Expand All @@ -59,6 +61,11 @@ ARCH=${ARCH:-x86_64}
run docker exec "${cid}" ssh -V
assert_success

run docker exec "${cid}" sh -c "command -v git"
assert_success
run docker exec "${cid}" git lfs version
assert_output --partial "${GIT_LFS_VERSION}"

run docker exec "${cid}" sh -c "printenv | grep AGENT_WORKDIR"
assert_equal "${output}" "AGENT_WORKDIR=/home/jenkins/agent"

Expand Down