-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile-python
More file actions
46 lines (39 loc) · 1.89 KB
/
Copy pathDockerfile-python
File metadata and controls
46 lines (39 loc) · 1.89 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
# syntax=docker/dockerfile:experimental
FROM python:3.10
# We set this environment variable and install git while building to try and
# increase the stability of fetching the rust crates needed to build the
# cryptography library
ARG CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN set -ex \
&& rm -rf /etc/apt/sources.list.d \
&& echo 'deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib' > /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.huaweicloud.com/debian-security bookworm-security main' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.huaweicloud.com/debian-security bookworm-security main' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib' >> /etc/apt/sources.list
RUN set -ex \
&& mkdir /root/.pip \
&& echo '[global]' > /root/.pip/pip.conf \
&& echo 'index-url = https://mirrors.bfsu.edu.cn/pypi/web/simple/' >> /root/.pip/pip.conf
RUN apt-get update && apt-get install -y \
pkg-config \
patchelf \
clang \
llvm \
ccache \
python3-dev \
rustc \
cargo \
build-essential \
libssl-dev \
libffi-dev \
git \
--no-install-recommends
RUN pip install --upgrade pip setuptools
# https://github.com/rust-lang/cargo/issues/8719
RUN --mount=type=tmpfs,target=/root/.cargo \
pip3 install --no-cache-dir cryptography==39.0.2
RUN pip install --upgrade poetry