Skip to content

Commit

Permalink
Set POETRY_VERSION as build argument in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanZRasa committed Jul 10, 2024
1 parent 3c18a61 commit e352663
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}"
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit e352663

Please sign in to comment.