Skip to content

Commit

Permalink
change base image to bookworm (#32)
Browse files Browse the repository at this point in the history
* change base image

* deps: remove unstructured and keep only unstructured-client
  • Loading branch information
nicoloboschi authored May 15, 2024
1 parent 02b4031 commit 719e0ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<python-version>-slim-buster`.
* `base-image` customizes the base image. If not defined, the default base image is `python:<python-version>-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
Expand Down
2 changes: 1 addition & 1 deletion poetry_dockerize_plugin/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 5 additions & 5 deletions tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -109,15 +109,15 @@ 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:
config = parse_pyproject_toml(test_project)
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
Expand All @@ -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
Expand Down

0 comments on commit 719e0ca

Please sign in to comment.