Skip to content

Commit 592cc2d

Browse files
committed
Check for bash existence instead of only mentioning it in a comment
1 parent b982d6d commit 592cc2d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

core/src/test/resources/internal-port-check-dockerfile/Dockerfile-bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# If you ever upgrade this image, watch out for bash being installed by default in newer alpine base images
21
FROM nginx:1.17-alpine
32

43
RUN apk add bash

core/src/test/resources/internal-port-check-dockerfile/Dockerfile-nc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# If you ever upgrade this image, watch out for bash being installed by default in newer alpine base images
21
FROM nginx:1.17-alpine
32

3+
# If this fails, you ended up using a base image with bash installed. Consider removing /bin/bash in this case
4+
RUN if bash -c true &> /dev/null; then exit 1; fi
5+
46
# Make sure the /proc/net/tcp* check fails in this container
57
RUN rm /usr/bin/awk
68

core/src/test/resources/internal-port-check-dockerfile/Dockerfile-tcp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# If you ever upgrade this image, watch out for bash being installed by default in newer alpine base images
21
FROM nginx:1.17-alpine
32

3+
# If this fails, you ended up using a base image with bash installed. Consider removing /bin/bash in this case
4+
RUN if bash -c true &> /dev/null; then exit 1; fi
5+
46
# Make sure the nc check fails in this container
57
RUN rm /usr/bin/nc
68

0 commit comments

Comments
 (0)