-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.debian
33 lines (28 loc) · 915 Bytes
/
Dockerfile.debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# syntax = docker/dockerfile:1.3-labs
#
# Build wheel for debian 12 in docker
# $ export DOCKER_BUILDKIT=1
# $ docker build -f Dockerfile.debian . -o wheels
# $ pip install wheels/*.whl
#
# Author: Elan Ruusamäe <glen@pld-linux.org>
FROM python:3.11-bookworm AS base
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_ROOT_USER_ACTION=ignore
FROM base AS build-wheels
RUN \
--mount=type=cache,id=pip,target=/root/.cache/pip \
--mount=type=cache,id=apt-cache,target=/var/cache/apt \
--mount=type=cache,id=apt-lib,target=/var/lib/apt \
<<eot
# Add dev deps
apt update && apt install -y --no-install-recommends libfuse-dev
# Download wheels/sources
pip download --dest /wheels fuse-python
# Build missing wheels
set -- $(ls /wheels/*.gz /wheels/*.zip 2>/dev/null)
pip wheel "$@" --wheel-dir=/wheels
eot
# docker build -f Dockerfile.debian . -o wheels
FROM scratch AS wheels
COPY --from=build-wheels /wheels .