11# syntax=docker/dockerfile:1
22
3- ARG PYTHON_VERSION="3.11.9"
4- ARG UV_VERSION="0.5"
5- FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
6- FROM python:${PYTHON_VERSION}-slim-bookworm AS base
73
4+ FROM cruizba/ubuntu-dind:latest AS base
5+ ARG PYTHON_VERSION
86LABEL maintainer=bisgaard-itis
97
10- # NOTE: to list the latest version run `make` inside `scripts/apt-packages-versions`
11- ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm"
12-
13- # -------------------------- Install docker -------------------
14- # for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
15- RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
16- echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
17- RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
18- set -eux; \
19- apt-get update; \
20- apt-get install -y --no-install-recommends \
21- gosu \
22- ca-certificates \
23- curl \
24- gnupg \
25- lsb-release \
26- && mkdir -p /etc/apt/keyrings \
27- && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
28- && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
29- $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
30- && apt-get update \
31- && apt-get install -y --no-install-recommends \
32- # only the cli is needed and we remove the unnecessary stuff again
33- docker-ce-cli=${DOCKER_APT_VERSION} \
34- && apt-get remove -y\
35- gnupg \
36- curl \
37- lsb-release \
38- && apt-get clean -y\
39- # verify that the binary works
40- && gosu nobody true
41-
428# Sets utf-8 encoding for Python et al
439ENV LANG=C.UTF-8
10+ ENV UV_PYTHON=${PYTHON_VERSION}
4411
4512# Turns off writing .pyc files; superfluous on an ephemeral container.
4613ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -50,27 +17,17 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
5017# those from our virtualenv.
5118ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
5219
53-
54- # -------------------------- Build stage -------------------
55- # Installs build/package management tools and third party dependencies
56- #
57- # + /build WORKDIR
58- #
59- FROM base AS build
60-
6120ENV SC_BUILD_TARGET=build
6221
63- RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
64- set -eux \
65- && apt-get update \
22+ RUN apt-get update \
6623 && apt-get install -y --no-install-recommends \
6724 build-essential \
6825 curl \
6926 git \
7027 jq
7128
7229# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
73- COPY --from=uv_build /uv /uvx /bin/
30+ COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /uvx /bin/
7431
7532RUN uv venv "${VIRTUAL_ENV}"
7633
0 commit comments