File tree Expand file tree Collapse file tree 4 files changed +11
-16
lines changed
scripts/apt-packages-versions Expand file tree Collapse file tree 4 files changed +11
-16
lines changed Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
2- FROM python:3.6-slim AS base
2+ ARG PYTHON_VERSION="3.11.9"
3+ ARG UV_VERSION="0.4"
4+ FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
5+ # we docker image is built based on debian
6+ FROM python:${PYTHON_VERSION}-slim-bookworm AS base
37
48LABEL maintainer=sanderegg
59
@@ -30,7 +34,6 @@ RUN uv venv "${VIRTUAL_ENV}"
3034
3135RUN --mount=type=cache,target=/root/.cache/uv \
3236 uv pip install --upgrade \
33- pip~=24.0 \
3437 wheel \
3538 setuptools
3639
Original file line number Diff line number Diff line change @@ -43,12 +43,13 @@ ENV LANG=C.UTF-8
4343# Turns off writing .pyc files; superfluous on an ephemeral container.
4444ENV PYTHONDONTWRITEBYTECODE=1 \
4545 VIRTUAL_ENV=/home/scu/.venv
46+ # https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
47+ ENV UV_COMPILE_BYTECODE=1
4648
4749# Ensures that the python and pip executables used
4850# in the image will be those from our virtualenv.
4951ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
5052
51-
5253# -------------------------- Build stage -------------------
5354
5455FROM base AS build
@@ -90,10 +91,6 @@ FROM base AS development
9091# NOTE: this is necessary to allow to build development images but is the same as production here
9192FROM base AS production
9293
93- ENV PYTHONOPTIMIZE=TRUE
94- # https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
95- ENV UV_COMPILE_BYTECODE=1
96-
9794WORKDIR /home/scu
9895# ensure home folder is read/writable for user scu
9996RUN chown -R scu /home/scu
@@ -102,7 +99,5 @@ USER scu
10299
103100COPY --from=build --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV}
104101
105- # NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE
106- # https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
107- ENV UV_COMPILE_BYTECODE=1 since excutable contains pytest code
102+ # NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE since excutable contains pytest code
108103ENTRYPOINT [ "ooil" ]
Original file line number Diff line number Diff line change 99#
1010#
1111ARG PYTHON_VERSION="3.11.9"
12+ ARG UV_VERSION="0.4"
13+ FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
14+ # we docker image is built based on debian
1215FROM python:${PYTHON_VERSION}-slim-bookworm AS base
1316
1417ENV VIRTUAL_ENV=/home/scu/.venv
@@ -39,7 +42,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
3942# devenv
4043RUN --mount=type=cache,target=/root/.cache/uv \
4144 uv pip install \
42- pip-tools \
4345 pipreqs \
4446 pipdeptree && \
4547 uv pip list -vv
Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
2-
3- # Define arguments in the global scope
42ARG PYTHON_VERSION="3.11.9"
5- ARG UV_VERSION="0.4"
6- FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
7- # we docker image is built based on debian
83FROM python:${PYTHON_VERSION}-slim-bookworm AS base
94
105RUN \
You can’t perform that action at this time.
0 commit comments