-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (43 loc) · 1.32 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
# Dockerfile for building a Linux ARM64 executable
# Stage 1: Build the executable
FROM arm64v8/python:3.12 AS builder
# Install required dependencies
RUN apt-get update -y && apt-get install -y \
build-essential \
libffi-dev \
libssl-dev \
wget \
libdbus-1-3 \
libxkbcommon0 \
libwayland-client0 \
libwayland-cursor0 \
libwayland-egl1 \
libxcb-keysyms1 \
libxcb-shape0 \
libxcb-xfixes0 \
libxcb-xkb1 \
libxcb-sync1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-glx0 \
&& apt-get clean
# Install PyInstaller and required Python packages
RUN pip install --upgrade pip
RUN pip install pyinstaller pyside6 pyinstaller-hooks-contrib tomli_w
# Set the working directory in the container
WORKDIR /app
# CUT HERE
# Copy the entire project into the container
COPY . .
# Run PyInstaller to create the executable
RUN pyinstaller --name MultipackParser --onefile --windowed --icon=path_to_your_icon.ico main.py
# Stage 2: Copy the executable to a minimal base image
FROM arm64v8/python:3.12-slim
WORKDIR /app
# Copy the executable to the app directory
COPY --from=builder /app/dist/MultipackParser /app/dist/MultipackParser
# Set entrypoint to the built executable
ENTRYPOINT ["/app/dist/MultipackParser/MultipackParser"]