Skip to content

Commit b34b062

Browse files
committed
RHAIENG-287: fix(Dockerfiles): use pip install --no-cache-dir to avoid Hadolint DL3042 warning
``` ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:214 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:239 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:308 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` ./codeserver/ubi9-python-3.12/Dockerfile.cpu:53 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` ./jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu:32 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` ```
1 parent 9ef9e68 commit b34b062

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ COPY ${CODESERVER_SOURCE_CODE}/devel_env_setup.sh ./
5151
# we need to ensure the same cache directory is mounted in
5252
# the final stage with the necessary permissions to consume from cache
5353
RUN --mount=type=cache,target=/root/.cache/uv \
54-
pip install --no-cache uv && \
54+
pip install --no-cache-dir uv && \
5555
# the devel script is ppc64le specific - sets up build-time dependencies
5656
source ./devel_env_setup.sh && \
5757
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,

jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ if [ "${TARGETARCH}" = "ppc64le" ]; then
197197
cd onnx
198198
git checkout ${ONNX_VERSION}
199199
git submodule update --init --recursive
200-
pip install -r requirements.txt
200+
pip install --no-cache-dir -r requirements.txt
201201
CMAKE_ARGS="-DPython3_EXECUTABLE=$(which python3.12)"
202202
export CMAKE_ARGS
203203
pip wheel . -w /root/onnx_wheel
@@ -307,7 +307,7 @@ COPY --from=onnx-builder /root/onnx_wheel/ /onnxwheels/
307307
RUN <<'EOF'
308308
set -Eeuxo pipefail
309309
if [ "${TARGETARCH}" = "ppc64le" ]; then
310-
pip install /onnxwheels/*.whl
310+
pip install --no-cache-dir /onnxwheels/*.whl
311311
else
312312
echo "Skipping ONNX/OpenBLAS install on non-Power"
313313
fi

jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ COPY ${TRUSTYAI_SOURCE_CODE}/pylock.toml .
3030
COPY ${TRUSTYAI_SOURCE_CODE}/devel_env_setup.sh .
3131

3232
RUN --mount=type=cache,target=/root/.cache/uv \
33-
pip install --no-cache uv && \
33+
pip install --no-cache-dir uv && \
3434
# the devel script is ppc64le specific - sets up build-time dependencies
3535
source ./devel_env_setup.sh && \
3636
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,

runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
225225
git clone --recursive https://github.com/onnx/onnx.git && \
226226
cd onnx && git checkout v${ONNX_VERSION} && \
227227
git submodule update --init --recursive && \
228-
pip install -r requirements.txt && \
228+
pip install --no-cache-dir -r requirements.txt && \
229229
CMAKE_ARGS="-DPython3_EXECUTABLE=$(which python3.12)" && \
230230
export CMAKE_ARGS && \
231231
pip wheel . -w /onnx_wheels; \
@@ -249,7 +249,7 @@ RUN echo "arrow-builder stage TARGETARCH: ${TARGETARCH}"
249249
RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
250250
git clone -b apache-arrow-${PYARROW_VERSION} https://github.com/apache/arrow.git --recursive && \
251251
cd arrow && rm -rf .git && mkdir dist && \
252-
pip3 install -r python/requirements-build.txt && \
252+
pip3 install --no-cache-dir -r python/requirements-build.txt && \
253253
ARROW_HOME=$(pwd)/dist && \
254254
export ARROW_HOME && \
255255
LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH && \
@@ -281,7 +281,7 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
281281
export PYARROW_WITH_PARQUET=1 && \
282282
export PYARROW_WITH_DATASET=1 && \
283283
export PYARROW_BUNDLE_ARROW_CPP=1 && \
284-
pip3 install wheel && \
284+
pip3 install --no-cache-dir wheel && \
285285
cd ../../python && \
286286
python setup.py build_ext \
287287
--build-type=release \
@@ -319,7 +319,7 @@ COPY --from=arrow-builder /arrowwheels /tmp/arrowwheels
319319

320320
RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
321321
echo "Installing ppc64le ONNX, pyarrow wheels and OpenBLAS..." && \
322-
HOME=/root pip install /tmp/onnx_wheels/*.whl /tmp/arrowwheels/*.whl && \
322+
HOME=/root pip install --no-cache-dir /tmp/onnx_wheels/*.whl /tmp/arrowwheels/*.whl && \
323323
if [ -d "/openblas" ] && [ "$(ls -A /openblas 2>/dev/null)" ]; then \
324324
PREFIX=/usr/local make -C /openblas install; \
325325
fi && rm -rf /openblas /tmp/onnx_wheels /tmp/arrowwheels; \

0 commit comments

Comments
 (0)