-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (58 loc) · 1.92 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
# syntax=docker/dockerfile:1
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
apt-get update
apt-get install -y ca-certificates
rm -rf /var/lib/apt/lists/*
EOF
COPY <<EOF /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
EOF
ENV TZ=Asia/Shanghai
RUN <<EOF
apt-get update
apt-get install -y tzdata
apt-get install -y locales && locale-gen en_US.UTF-8
apt-get install -y gosu
rm -rf /var/lib/apt/lists/*
EOF
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
RUN <<EOF
apt-get update
apt-get install -y git
apt-get install -y build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
rm -rf /var/lib/apt/lists/*
EOF
ENV PYENV_ROOT="/usr/local/pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
ARG PYTHON_VERSION="3.10"
# https://github.com/pyenv/pyenv/pull/2592
# https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-for-maximum-performance
ARG PYTHON_CONFIGURE_OPTS="--disable-shared --enable-optimizations --with-lto"
ARG PYTHON_CFLAGS="-march=native -mtune=native"
RUN <<EOF
curl https://pyenv.run | bash
pyenv install $PYTHON_VERSION
pyenv global $PYTHON_VERSION
EOF
RUN <<EOF
python -m pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir nuitka
EOF
RUN <<EOF
apt-get update
apt-get install -y ccache patchelf
rm -rf /var/lib/apt/lists/*
EOF
WORKDIR /code
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
COPY docker-cmd.sh /usr/local/bin/
CMD ["docker-cmd.sh"]