Skip to content

Commit 168640f

Browse files
committed
♻️ Always use Debian Base image. Install python via UV.
To prevent different underlying systems, pin to debian Bookworm and install Python using UV
1 parent e8c27d0 commit 168640f

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,24 @@ ARG USERNAME=ContainerUser
44
ARG PYTHONVERSION=3.11
55

66
# ############################################################################################################
7-
FROM python:${PYTHONVERSION} AS python-base
7+
FROM debian:bookworm AS python-base
88

9-
ENV POETRY_VERSION=2.1.1
10-
ENV POETRY_CACHE_DIR=/var/cache/poetry \
11-
POETRY_HOME=/opt/poetry \
12-
PATH=/opt/poetry/bin:${PATH}\
13-
PYTHONFAULTHANDLER=1 \
9+
ENV PYTHONFAULTHANDLER=1 \
1410
PYTHONUNBUFFERED=1 \
1511
PIP_CACHE_DIR=/var/cache/pip
16-
RUN mkdir -p $PIP_CACHE_DIR $POETRY_CACHE_DIR
12+
RUN mkdir -p $PIP_CACHE_DIR
1713

18-
# ############################################################################################################
19-
FROM python-base AS devcontainer
2014
ARG USERNAME
2115
LABEL org.opencontainers.image.source=https://github.com/OpenJKSoftware/python-devcontainer
2216

2317
# Install uv
2418
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
2519
ENV UV_CACHE_DIR=/var/cache/uv \
26-
UV_LINK_MODE=copy
27-
RUN mkdir -p $UV_CACHE_DIR
20+
UV_PYTHON_CACHE_DIR=/var/cache/uv/python \
21+
UV_LINK_MODE=copy \
22+
UV_COMPILE_BYTECODE=1
23+
RUN set -x; mkdir -p $UV_CACHE_DIR && mkdir -p $UV_PYTHON_CACHE_DIR
24+
RUN --mount=type=cache,target=/var/cache uv python install ${PYTHONVERSION} --install-deps --default
2825

2926
# Install Base Reqs
3027
COPY scripts/install_base_deps.sh /tmp/

0 commit comments

Comments
 (0)