-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-for-pyinstaller
More file actions
28 lines (24 loc) · 1.12 KB
/
Dockerfile-for-pyinstaller
File metadata and controls
28 lines (24 loc) · 1.12 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
# Dockerfile to build single self-contained executable for smaht-submitr using pyinstaller.
# Tested with IMAGE values: centos, arm64v8/centos - for x86_64 and arm64 architectures respectively.
# FYI: It turns out that binaries built on RedHat (CentOS) work on Debian (Ubuntu); but not vice versa.
ARG IMAGE=
FROM ${IMAGE}
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum install sudo -y
RUN sudo yum install git python3 gcc make bzip2 zlib-devel readline-devel sqlite-devel openssl-devel tk-devel libffi-devel wget xz-devel -y
WORKDIR /app
COPY . .
RUN curl https://pyenv.run | /bin/bash
RUN export PYENV_ROOT="$HOME/.pyenv" ; \
export PATH="$PYENV_ROOT/bin:$PATH" ; \
eval "$(pyenv init -)" ; \
eval "$(pyenv virtualenv-init -)" ; \
pyenv install 3.11.8 ; \
pyenv virtualenv 3.11.8 submitr-3.11 ; \
pyenv activate submitr-3.11 ; \
make build ; \
pip install pyinstaller ; \
pyinstaller --onefile submitr/scripts/submitr.py
RUN chmod a+x dist/submitr
CMD ["./dist/submitr"]