From 719e0ca1106e07f28f8e66bef93c7b73baf03eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Wed, 15 May 2024 11:48:21 +0200 Subject: [PATCH] change base image to bookworm (#32) * change base image * deps: remove unstructured and keep only unstructured-client --- README.md | 2 +- poetry_dockerize_plugin/builder.py | 2 +- tests/test_builder.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 33b491a..2c074af 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ build-poetry-install-args = ["-E", "all", "--no-root"] * `name` customizes the docker image name. * `python` python version to use. If not specified, will try to be extracted from `tool.poetry.dependencies.python`. Default is `3.11` -* `base-image` customizes the base image. If not defined, the default base image is `python:-slim-buster`. +* `base-image` customizes the base image. If not defined, the default base image is `python:-slim-bookworm`. * `tags` declares a list of tags for the image. * `entrypoint` customizes the entrypoint of the image. If not provided, the default entrypoint is retrieved from the `packages` configuration. * `ports` exposes ports diff --git a/poetry_dockerize_plugin/builder.py b/poetry_dockerize_plugin/builder.py index 2c8b52e..038aaf7 100644 --- a/poetry_dockerize_plugin/builder.py +++ b/poetry_dockerize_plugin/builder.py @@ -147,7 +147,7 @@ def parse_pyproject_toml(pyproject_path) -> ProjectConfiguration: print(f"Declared python version dependency is too complex, using default: {python_version}") else: print(f"Python version extracted from project configuration: {python_version}") - config.base_image = f"python:{python_version}-slim-buster" + config.base_image = f"python:{python_version}-slim-bookworm" else: config.base_image = f"python:{dockerize_section.python}-slim-buster" diff --git a/tests/test_builder.py b/tests/test_builder.py index 31ac1f3..984a4e8 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -91,7 +91,7 @@ def test_parse_pyversion() -> None: version = "0.1.0" packages = [{include = "app"}] """) - assert doc.base_image == "python:3.11-slim-buster" + assert doc.base_image == "python:3.11-slim-bookworm" doc = _parse_pyproject_toml_content(""" [tool.poetry] name = "my-app" @@ -100,7 +100,7 @@ def test_parse_pyversion() -> None: [tool.poetry.dependencies] python = "^3.9" """) - assert doc.base_image == "python:3.9-slim-buster" + assert doc.base_image == "python:3.9-slim-bookworm" doc = _parse_pyproject_toml_content(""" [tool.poetry] name = "my-app" @@ -109,7 +109,7 @@ def test_parse_pyversion() -> None: [tool.poetry.dependencies] python = ">3.9,<3.12" """) - assert doc.base_image == "python:3.11-slim-buster" + assert doc.base_image == "python:3.11-slim-bookworm" def test_parse() -> None: @@ -117,7 +117,7 @@ def test_parse() -> None: content = generate_docker_file_content(config, test_project) print(content) assert content == """ -FROM python:3.11-slim-buster as builder +FROM python:3.11-slim-bookworm as builder RUN pip install poetry==1.7.1 ENV POETRY_VIRTUALENVS_IN_PROJECT=1 @@ -141,7 +141,7 @@ def test_parse() -> None: RUN cd /app && poetry install --no-interaction --no-ansi -E ext -FROM python:3.11-slim-buster as runtime +FROM python:3.11-slim-bookworm as runtime ARG DEBIAN_FRONTEND=noninteractive