diff --git a/images/python-base/Dockerfile b/images/python-base/Dockerfile index 94a110c..630d91a 100644 --- a/images/python-base/Dockerfile +++ b/images/python-base/Dockerfile @@ -1,10 +1,14 @@ -# e.g., "3.10" +# > An ARG declared before a FROM is outside of a build stage, so it can't be used in any instruction after a FROM +# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact + +# Specify "base" Python image e.g., "3.10" ARG PYTHON_VERSION -# e.g., 2024.01.17.15.09.31 -ARG TIMESTAMP FROM python:${PYTHON_VERSION}-slim as python-base-BASE +# For tracking deployed images later e.g., 2024.01.17.15.09.31 +ARG TIMESTAMP + # Python ENV PYTHONUNBUFFERED=1 \ # prevents python creating .pyc files @@ -18,19 +22,16 @@ ENV PYTHONUNBUFFERED=1 \ # do not ask any interactive question POETRY_NO_INTERACTION=1 \ # never create virtual environment automaticly, only use env prepared by us - POETRY_VIRTUALENVS_CREATE=false + POETRY_VIRTUALENVS_CREATE=false \ + # Update PATH to include pipx defautl + PATH="/root/.local/bin:${PATH}" # Install pipx. pipx installs Python CLI programs in an isolated environment # in addition it makes the CLI entry points available on $PATH -RUN pip install --upgrade pipx && \ - pipx ensurepath +RUN pip install --upgrade pipx # Install poetry via pipx # https://python-poetry.org/docs/#installing-with-pipx -# -# NOTE: this will emit "'/root/.local/bin' is not on your PATH environment variable." -# This is true at install time but at runtime a new shell will be started that -# has that fixed per `pipx ensurepath` above RUN pipx install poetry # Leave a note behind so we can always quickly determine our original image