Skip to content

Commit

Permalink
Make container image smaller
Browse files Browse the repository at this point in the history
Additionally removes system-installed pip and cleans DNF cache.
  • Loading branch information
hluk committed May 5, 2022
1 parent dd699a7 commit c639e6d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5 as base

RUN microdnf install -y --nodocs --setopt install_weak_deps=0 python39-pip
RUN microdnf install -y --nodocs --setopt install_weak_deps=0 \
python39 \
python39-pip \
&& microdnf clean -y all

ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
Expand Down Expand Up @@ -48,6 +51,8 @@ COPY --from=builder /venv /venv
RUN set -ex \
&& /venv/bin/pip install --no-cache-dir dist/*.whl \
&& rm -r dist \
&& microdnf remove -y python39-pip \
&& microdnf clean -y all \
# This will allow a non-root user to install a custom root CA at run-time
&& chmod 777 /etc/pki/tls/certs/ca-bundle.crt

Expand Down

0 comments on commit c639e6d

Please sign in to comment.