-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
55 lines (43 loc) · 1.27 KB
/
Dockerfile.build
File metadata and controls
55 lines (43 loc) · 1.27 KB
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
# --- musl (Alpine) ---
FROM python:3.11-alpine AS builder-musl
RUN apk add --no-cache \
binutils \
gcc \
musl-dev \
libffi-dev
RUN pip install --no-cache-dir pyinstaller poetry
WORKDIR /build
COPY pyproject.toml poetry.lock README.md ./
COPY src/ src/
RUN poetry config virtualenvs.create false \
&& poetry install --only main --no-interaction
RUN pyinstaller \
--onefile \
--name flow-deploy-linux-musl \
--strip \
--noupx \
--copy-metadata flow-deploy \
src/flow_deploy/cli.py
# --- glibc (Ubuntu/Debian) ---
FROM python:3.11-slim AS builder-glibc
RUN apt-get update && apt-get install -y --no-install-recommends \
binutils \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir pyinstaller poetry
WORKDIR /build
COPY pyproject.toml poetry.lock README.md ./
COPY src/ src/
RUN poetry config virtualenvs.create false \
&& poetry install --only main --no-interaction
RUN pyinstaller \
--onefile \
--name flow-deploy-linux-glibc \
--strip \
--noupx \
--copy-metadata flow-deploy \
src/flow_deploy/cli.py
# --- collect both binaries ---
FROM alpine:3.19
COPY --from=builder-musl /build/dist/flow-deploy-linux-musl /dist/
COPY --from=builder-glibc /build/dist/flow-deploy-linux-glibc /dist/