From 1f74c6a4646158328f127c494950ed0ac72a234b Mon Sep 17 00:00:00 2001 From: till Date: Sat, 25 Nov 2023 14:07:27 +0100 Subject: [PATCH] Update: image - set poetry version - add entrypoint - remove POETRY_CMD env --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffe01a4..2058e93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,17 +2,24 @@ FROM python:3.11.4-slim-buster LABEL org.opencontainers.image.description "Docker (base) image with Python 3.x with poetry" +ARG POETRY_VERSION=1.2.0 +ARG POETRY_HOME=/opt/poetry + # making this explicit USER root -ENV POETRY_CMD=/root/.local/bin/poetry -RUN apt-get update -y \ +ADD https://install.python-poetry.org /tmp/install-poetry + +RUN apt update -y \ && apt install \ --no-install-recommends -y \ build-essential \ jq \ - && pip install --user poetry \ - && rm -rf /root/.cache/pip \ + && POETRY_VERSION=${POETRY_VERSION} python3 /tmp/install-poetry \ + && rm /tmp/install-poetry \ + && ln -s ${POETRY_HOME}/bin/poetry /usr/local/bin/poetry \ && mkdir -p /workspace WORKDIR /workspace + +ENTRYPOINT ["/usr/local/bin/poetry"]