diff --git a/Dockerfile b/Dockerfile index a9d38afe2..4b3cb2e64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100 \ FROM base AS python_builder +ARG POETRY_VERSION=1.8.2 + # hadolint ignore=DL3008 RUN apt-get update -qq \ && apt-get install -y --no-install-recommends \ @@ -26,7 +28,7 @@ RUN apt-get update -qq \ # install poetry # keep this in sync with the version in pyproject.toml and Dockerfile -ENV POETRY_VERSION=1.8.2 +ENV POETRY_VERSION=$POETRY_VERSION SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN curl -sSL https://install.python-poetry.org | python ENV PATH="/root/.local/bin:/opt/venv/bin:${PATH}" diff --git a/Makefile b/Makefile index 57daad49c..22e970cac 100644 --- a/Makefile +++ b/Makefile @@ -41,9 +41,11 @@ lint-docstrings: ## check docstrings IMAGE_NAME ?= rasa/rasa-sdk IMAGE_TAG ?= latest PLATFORM ?= linux/arm64 +POETRY_VERSION ?= $(shell ./scripts/poetry-version.sh) build-docker: ## build docker image for one platform docker build . \ + --build-arg POETRY_VERSION=$(POETRY_VERSION) \ --platform=$(PLATFORM) \ -f Dockerfile \ -t $(IMAGE_NAME):$(IMAGE_TAG) @@ -53,7 +55,8 @@ build-docker: ## build docker image for one platform build-and-push-multi-platform-docker: PLATFORM = linux/amd64,linux/arm64 build-and-push-multi-platform-docker: ## build and push multi-platform docker image docker buildx build . \ - --platform=$(PLATFORM) \ + --build-arg POETRY_VERSION=$(POETRY_VERSION) \ + --platform=$(PLATFORM) \ -f Dockerfile \ -t $(IMAGE_NAME):$(IMAGE_TAG) \ --push