Skip to content

Commit

Permalink
Merge pull request #35 from max-pfeiffer/feature/os_and_arch_update
Browse files Browse the repository at this point in the history
Feature/os and arch update
  • Loading branch information
max-pfeiffer authored Aug 3, 2023
2 parents f227aeb + e01b246 commit 9d54461
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ This multiarch image supports AMD64 and ARM64 architectures.
* v3.11

**Operating system:**
* [Debian Bullseye v10.13](https://www.debian.org/releases/bullseye/)
* [Debian Bullseye slim v10.13](https://www.debian.org/releases/bullseye/)
* [Debian Bookworm v12.1](https://www.debian.org/releases/bookworm/)
* [Debian Bookworm slim v12.1](https://www.debian.org/releases/bookworm/)

**CPU architectures**
* linux/amd64
* linux/arm64
* linux/arm64/v8
23 changes: 13 additions & 10 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# References: using official Python images
# https://hub.docker.com/_/python
ARG OFFICIAL_PYTHON_IMAGE
FROM ${OFFICIAL_PYTHON_IMAGE}
FROM ${OFFICIAL_PYTHON_IMAGE} as build-stage
ARG POETRY_VERSION

LABEL maintainer="Max Pfeiffer <[email protected]>"
Expand All @@ -21,14 +21,17 @@ ENV PIP_NO_CACHE_DIR=off \
POETRY_VERSION=${POETRY_VERSION} \
POETRY_HOME="/opt/poetry"

ENV PATH="$POETRY_HOME/bin:$PATH"

# https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
curl \
&& curl -sSL https://install.python-poetry.org | python - \
&& apt-get purge --auto-remove -y \
build-essential \
curl
build-essential

# https://python-poetry.org/docs/#installing-manually
RUN python -m venv ${POETRY_HOME}
RUN ${POETRY_HOME}/bin/pip install -U pip setuptools
RUN ${POETRY_HOME}/bin/pip install "poetry==${POETRY_VERSION}"

FROM ${OFFICIAL_PYTHON_IMAGE} as production-image

ENV PATH="/opt/poetry/bin:$PATH"

COPY --from=build-stage /opt/poetry /opt/poetry/
3 changes: 2 additions & 1 deletion build/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ variable "CONTEXT" {
target "python-poetry" {
name = "poetry${replace(poetry_version, ".", "-")}-python${replace(python_version, ".", "-")}-${os_variant}"
context = CONTEXT
target = "production-image"

matrix = {
python_version = ["3.9.17", "3.10.12", "3.11.4"]
os_variant = ["bullseye", "slim-bullseye"]
os_variant = ["bookworm", "slim-bookworm"]
poetry_version = ["1.3.2", "1.4.2", "1.5.1"]
}

Expand Down

0 comments on commit 9d54461

Please sign in to comment.