Skip to content

Commit ea1b6f8

Browse files
authored
Merge pull request #181 from gounthar/adding-explicitely-less-and-patch
chore(linux) Add `less` and `patch` packages explicitly and a test to validate the installation
2 parents 5f3d663 + 52674ac commit ea1b6f8

File tree

7 files changed

+26
-5
lines changed

7 files changed

+26
-5
lines changed

11/alpine/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ RUN mkdir -p "${JENKINS_AGENT_HOME}/.ssh/" \
4040
RUN apk add --no-cache \
4141
bash \
4242
git-lfs \
43+
less \
4344
netcat-openbsd \
44-
openssh
45+
openssh \
46+
patch
4547

4648
# setup SSH server
4749
RUN sed -i /etc/ssh/sshd_config \

11/bullseye/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ RUN groupadd -g ${gid} ${group} \
4747
RUN apt-get update \
4848
&& apt-get install --no-install-recommends -y \
4949
git-lfs \
50+
less \
5051
netcat-traditional \
5152
openssh-server \
53+
patch \
5254
&& rm -rf /var/lib/apt/lists/*
5355

5456
# setup SSH server

17/alpine/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ RUN mkdir -p "${JENKINS_AGENT_HOME}/.ssh/" \
4040
RUN apk add --no-cache \
4141
bash \
4242
git-lfs \
43+
less \
4344
netcat-openbsd \
44-
openssh
45+
openssh \
46+
patch
4547

4648
# setup SSH server
4749
RUN sed -i /etc/ssh/sshd_config \

17/bullseye/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ RUN groupadd -g ${gid} ${group} \
2525
RUN apt-get update \
2626
&& apt-get install --no-install-recommends -y \
2727
git-lfs \
28+
less \
2829
netcat-traditional \
2930
openssh-server \
31+
patch \
3032
&& rm -rf /var/lib/apt/lists/*
3133

3234
# setup SSH server

8/alpine/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ RUN mkdir -p "${JENKINS_AGENT_HOME}/.ssh/" \
4040
RUN apk add --no-cache \
4141
bash \
4242
git-lfs \
43+
less \
4344
netcat-openbsd \
44-
openssh
45+
openssh \
46+
patch
4547

4648
# setup SSH server
4749
RUN sed -i /etc/ssh/sshd_config \

8/bullseye/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ RUN groupadd -g ${gid} ${group} \
3737

3838
RUN apt-get update \
3939
&& apt-get install --no-install-recommends -y \
40-
git-lfs \
40+
git-lfs \
41+
less \
4142
netcat-traditional \
4243
openssh-server \
44+
patch \
4345
&& rm -rf /var/lib/apt/lists/*
4446

4547
# setup SSH server

tests/tests.bats

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ DOCKER_PLUGIN_DEFAULT_ARG="/usr/sbin/sshd -D -p 22"
189189
}
190190

191191

192-
@test "[${SUT_IMAGE}] image has git and SSH client installed and present in the PATH" {
192+
@test "[${SUT_IMAGE}] image has required tools installed and present in the PATH" {
193193
local test_container_name=${AGENT_CONTAINER}-bash-java
194194
clean_test_container "${test_container_name}"
195195
docker run --name="${test_container_name}" --name="${test_container_name}" "${docker_run_opts[@]}" "${PUBLIC_SSH_KEY}"
@@ -204,5 +204,14 @@ DOCKER_PLUGIN_DEFAULT_ARG="/usr/sbin/sshd -D -p 22"
204204
run docker exec "${test_container_name}" git --version
205205
assert_success
206206

207+
run docker exec "${test_container_name}" sh -c "command -v less"
208+
assert_success
209+
run docker exec "${test_container_name}" less -V
210+
assert_success
211+
run docker exec "${test_container_name}" sh -c "command -v patch"
212+
assert_success
213+
run docker exec "${test_container_name}" patch --version
214+
assert_success
215+
207216
clean_test_container "${test_container_name}"
208217
}

0 commit comments

Comments
 (0)