-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
124 lines (102 loc) · 3.82 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
FROM quay.io/pypa/manylinux_2_28_x86_64 as build-amd64
ENV LANG C.UTF-8
ENV MANYLINUX_PLATFORM manylinux_2_28_x86_64
FROM quay.io/pypa/manylinux_2_28_aarch64 as build-arm64
ENV LANG C.UTF-8
ENV MANYLINUX_PLATFORM manylinux_2_28_aarch64
# -----------------------------------------------------------------------------
# Python 3.9
# -----------------------------------------------------------------------------
ARG TARGETARCH
ARG TARGETVARIANT
FROM build-${TARGETARCH}${TARGETVARIANT} as python39
# Build
WORKDIR /build
COPY ./ ./
RUN python3.9 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade build wheel auditwheel && \
venv/bin/python3 -m build --wheel
RUN find dist -name '*.whl' | xargs auditwheel repair --plat "${MANYLINUX_PLATFORM}"
# Test
WORKDIR /test
COPY ./tests/ ./tests/
RUN python3.9 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade wheel pytest && \
venv/bin/pip3 install --no-index pymicro-vad -f /build/wheelhouse/ && \
venv/bin/pytest tests
# -----------------------------------------------------------------------------
# Python 3.10
# -----------------------------------------------------------------------------
ARG TARGETARCH
ARG TARGETVARIANT
FROM build-${TARGETARCH}${TARGETVARIANT} as python310
# Build
WORKDIR /build
COPY ./ ./
RUN python3.10 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade build wheel auditwheel && \
venv/bin/python3 -m build --wheel
RUN find dist -name '*.whl' | xargs auditwheel repair --plat "${MANYLINUX_PLATFORM}"
# Test
WORKDIR /test
COPY ./tests/ ./tests/
RUN python3.10 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade wheel pytest && \
venv/bin/pip3 install --no-index pymicro-vad -f /build/wheelhouse/ && \
venv/bin/pytest tests
# -----------------------------------------------------------------------------
# Python 3.11
# -----------------------------------------------------------------------------
ARG TARGETARCH
ARG TARGETVARIANT
FROM build-${TARGETARCH}${TARGETVARIANT} as python311
# Build
WORKDIR /build
COPY ./ ./
RUN python3.11 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade build wheel auditwheel && \
venv/bin/python3 -m build --wheel
RUN find dist -name '*.whl' | xargs auditwheel repair --plat "${MANYLINUX_PLATFORM}"
# Test
WORKDIR /test
COPY ./tests/ ./tests/
RUN python3.11 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade wheel pytest && \
venv/bin/pip3 install --no-index pymicro-vad -f /build/wheelhouse/ && \
venv/bin/pytest tests
# -----------------------------------------------------------------------------
# Python 3.12
# -----------------------------------------------------------------------------
ARG TARGETARCH
ARG TARGETVARIANT
FROM build-${TARGETARCH}${TARGETVARIANT} as python312
# Build
WORKDIR /build
COPY ./ ./
RUN python3.12 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade build wheel auditwheel && \
venv/bin/python3 -m build --wheel
RUN find dist -name '*.whl' | xargs auditwheel repair --plat "${MANYLINUX_PLATFORM}"
# Test
WORKDIR /test
COPY ./tests/ ./tests/
RUN python3.12 -m venv venv && \
venv/bin/pip3 install --upgrade pip && \
venv/bin/pip3 install --upgrade wheel pytest && \
venv/bin/pip3 install --no-index pymicro-vad -f /build/wheelhouse/ && \
venv/bin/pytest tests
# -----------------------------------------------------------------------------
FROM scratch
ARG TARGETARCH
ARG TARGETVARIANT
COPY --from=python39 /build/wheelhouse/ ./
COPY --from=python310 /build/wheelhouse/ ./
COPY --from=python311 /build/wheelhouse/ ./
COPY --from=python312 /build/wheelhouse/ ./