Skip to content

Commit

Permalink
Set the SHELL option -o pipefail before RUN
Browse files Browse the repository at this point in the history
Docker only evaluates the exit code of the last operation after the pipe
in a RUN statement to determine success. This update will cause the build
to fail due to an error at any stage in the RUN command with pipes.
  • Loading branch information
sbreker committed Apr 23, 2024
1 parent 1199ed4 commit a66db3b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions 1.1.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman
COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \

Check failure on line 12 in 1.1.15/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3003 info: Use WORKDIR to switch to a directory

Check failure on line 12 in 1.1.15/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`

Check failure on line 12 in 1.1.15/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

SC2086 info: Double quote to prevent globbing and word splitting.

Check failure on line 12 in 1.1.15/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3019 info: Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages

Check failure on line 12 in 1.1.15/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3047 info: Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`. Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`).
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman
COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \

Check failure on line 12 in 1.1.16/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3003 info: Use WORKDIR to switch to a directory

Check failure on line 12 in 1.1.16/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`

Check failure on line 12 in 1.1.16/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

SC2086 info: Double quote to prevent globbing and word splitting.

Check failure on line 12 in 1.1.16/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3019 info: Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages

Check failure on line 12 in 1.1.16/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles with Hadolint

DL3047 info: Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`. Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`).
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman
COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman
COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.19.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman
# COPY patches/libhashkit-common.h.patch /libhashkit-common.h.patch
COPY patches/libtest-cmdline.cc.patch /libtest-cmdline.cc.patch

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.20.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV GEARMAND_SHA1 054b3d7f7f6e0fae982fb1d467db5902b0b11ddc

RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman Server" gearman

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down
1 change: 1 addition & 0 deletions 1.1.21.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV GEARMAND_SHA1 472d2a0019e69edefcd0c1ff57e9352982e6d3f5

RUN addgroup -S gearman && adduser -G gearman -S -D -H -s /bin/false -g "Gearman Server" gearman

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
wget \
Expand Down

0 comments on commit a66db3b

Please sign in to comment.