Skip to content

Commit 455e2fa

Browse files
committed
fix: stackable-devel dnf and shell config
1 parent 0293728 commit 455e2fa

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

stackable-devel/Dockerfile

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ ARG STACKABLE_USER_UID
1616
ARG STACKABLE_USER_GID
1717
ARG STACKABLE_USER_NAME
1818

19+
# Sets the default shell to Bash with strict error handling and robust pipeline processing.
20+
# "-e": Exits immediately if a command exits with a non-zero status
21+
# "-u": Treats unset variables as an error, preventing unexpected behavior from undefined variables.
22+
# "-o pipefail": Causes a pipeline to return the exit status of the last command in the pipe that failed, ensuring errors in any part of a pipeline are not ignored.
23+
# "-c": Allows the execution of commands passed as a string
24+
# This is automatically inherited in all other Dockerfiles that use this unless it is overwritten
25+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
26+
27+
# We configure microdnf to not install weak dependencies in this file
28+
# Not doing this caused the content of images to become unpredictable because
29+
# based on which packages get updated by `microdnf update` new weak dependencies
30+
# might be installed that were not present earlier (the ubi base image doesn't
31+
# seem to install weak dependencies)
32+
# This also affects the packages that are installed in our Dockerfiles (java as prime
33+
# example).
34+
# https://github.com/stackabletech/docker-images/pull/533
35+
COPY stackable-base/stackable/dnf.conf /etc/dnf/dnf.conf
36+
1937
# This SHOULD be kept in sync with operator-templating and other tools to reduce build times
2038
# Find the latest version here: https://doc.rust-lang.org/stable/releases.html
2139
# renovate: datasource=github-releases packageName=rust-lang/rust
@@ -28,19 +46,19 @@ ENV CARGO_CYCLONEDX_CRATE_VERSION=0.5.7
2846
ENV CARGO_AUDITABLE_CRATE_VERSION=0.6.6
2947

3048
RUN <<EOF
31-
microdnf update --assumeyes
49+
microdnf update
3250

3351
# git: Needed to fetch source
3452
# gcc: Needed for compilation
35-
microdnf --assumeyes install \
53+
microdnf install \
3654
gcc \
3755
git
3856

3957
###
4058
### Add Stackable user and group
4159
###
4260
# Added only temporarily to create the user and group, removed again below
43-
microdnf --assumeyes install shadow-utils
61+
microdnf install shadow-utils
4462
groupadd --gid ${STACKABLE_USER_GID} --system ${STACKABLE_USER_NAME}
4563

4664
# The --no-log-init is required to work around a bug/problem in Go/Docker when very large UIDs are used
@@ -57,7 +75,7 @@ useradd \
5775
--create-home \
5876
--home-dir /stackable \
5977
${STACKABLE_USER_NAME}
60-
microdnf --assumeyes remove shadow-utils
78+
microdnf remove shadow-utils
6179

6280
microdnf clean all
6381
rm -rf /var/cache/yum
@@ -76,8 +94,8 @@ COPY rust/patchable/ /patchable/rust/patchable
7694
COPY Cargo.* /patchable/
7795

7896
RUN <<EOF
79-
microdnf update --assumeyes
80-
microdnf install --assumeyes openssl-devel pkg-config
97+
microdnf update
98+
microdnf install openssl-devel pkg-config
8199
cd /patchable
82100
. "$HOME/.cargo/env"
83101
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries

0 commit comments

Comments
 (0)