-
Notifications
You must be signed in to change notification settings - Fork 385
/
Dockerfile
45 lines (40 loc) · 1.36 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
FROM python:3.7-slim-buster
ENV PYPI_URL=https://pypi.tuna.tsinghua.edu.cn
ENV PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
RUN \
set -x &&\
# install gi to python3.7/site-packages
mkdir -p /usr/lib/python3 &&\
ln -s /usr/local/lib/python3.7/site-packages /usr/lib/python3/dist-packages &&\
# update system
apt-get update &&\
# install requirements
apt-get install -y --no-install-recommends \
binutils \
python3-gi \
libgtk-3-dev \
libappindicator3-dev \
upx \
git
RUN \
# specified a custom URL for PYPI
mkdir -p /root/.pip &&\
echo "[global]" > /root/.pip/pip.conf &&\
echo "index = $PYPI_URL" >> /root/.pip/pip.conf &&\
echo "index-url = $PYPI_INDEX_URL" >> /root/.pip/pip.conf &&\
echo "trusted-host = $(echo $PYPI_URL | perl -pe 's|^.*?://(.*?)(:.*?)?/.*$|$1|')" >> /root/.pip/pip.conf &&\
# install pyinstaller
pip install pyinstaller && \
mkdir /src/ &&\
# build entrypoint.sh
echo \#\!/bin/bash -i >> /entrypoint.sh &&\
echo >> /entrypoint.sh &&\
echo "set -e" >> /entrypoint.sh &&\
echo "cd /src" >> /entrypoint.sh &&\
echo "echo \"\$@\"" >> /entrypoint.sh &&\
echo "sh -c \"\$@\"" >> /entrypoint.sh &&\
chmod +x /entrypoint.sh
VOLUME /src/
WORKDIR /src/
SHELL ["/bin/bash", "-i", "-c"]
ENTRYPOINT ["/entrypoint.sh"]