Skip to content

Commit

Permalink
Using UBI work image for smaller container size
Browse files Browse the repository at this point in the history
If possible to upgrade to Python 3.9, we could use the UBI9 Python image to reduce size.
Fixes RedHat-Israel#451
  • Loading branch information
itroyano committed Apr 24, 2023
1 parent 7ee96f5 commit 23fd796
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generate a container that generates requirements.txt
ARG PY_VERSION=3.7
ARG PY_VERSION=3.9
FROM python:${PY_VERSION} as source

ARG DEV
Expand All @@ -14,14 +14,13 @@ COPY Pipfile ./Pipfile
# Generate requirements.txt file from Pipfile
RUN if [ -z ${DEV} ]; \
then \
pipenv lock -r > requirements.txt; \
pipenv lock > requirements.txt; \
else \
pipenv lock --dev -r > requirements.txt; \
pipenv lock --dev > requirements.txt; \
fi

# Generate work image
ARG PY_VERSION
FROM python:${PY_VERSION}
FROM registry.access.redhat.com/ubi9/python-39

# Project maintainer
LABEL maintainer="frolland@redhat.com"
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ idna = ">=2.5,<3"

[requires]

python_version = "3.7"
python_version = "3.9"

0 comments on commit 23fd796

Please sign in to comment.