forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
125 lines (107 loc) · 3.88 KB
/
Dockerfile
File metadata and controls
125 lines (107 loc) · 3.88 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
ARG REGISTRY="docker.io"
FROM ${REGISTRY}/library/fedora:29
USER root
# dnf configuration
RUN echo "timeout=60" >> /etc/dnf/dnf.conf && \
echo "retries=10" >> /etc/dnf/dnf.conf
RUN dnf update -y && dnf install -y \
git \
curl \
python3 \
# To build Python from source
openssl-devel \
sqlite-devel \
bzip2-devel \
libffi-devel \
zlib-devel \
wget \
make \
tar \
gcc \
gcc-c++ \
# parallel gzip
pigz \
xz
# Install build dependencies
ADD install_build_dependencies.sh /install_build_dependencies.sh
RUN chmod +x /install_build_dependencies.sh && \
bash -e /install_build_dependencies.sh && \
rm -rf /var/lib/apt/lists/*
# Build Pythons
# Python 3.10
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.10.16/Python-3.10.16.tar.xz && \
tar xvf Python-3.10.16.tar.xz
RUN cd /usr/src/Python-3.10.16 && \
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
make altinstall
# Python 3.11
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tar.xz && \
tar xvf Python-3.11.9.tar.xz
RUN cd /usr/src/Python-3.11.9 && \
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
make altinstall
# Python 3.12
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tar.xz && \
tar xvf Python-3.12.9.tar.xz
RUN cd /usr/src/Python-3.12.9 && \
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
make altinstall
# Python 3.13
RUN cd /usr/src && \
wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz && \
tar xvf Python-3.13.2.tar.xz
RUN cd /usr/src/Python-3.13.2 && \
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
make altinstall
# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
ENV SCCACHE_HOME="/opt/sccache" \
SCCACHE_PATH="/opt/sccache/sccache"
RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \
curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \
tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE}
ENV PATH="$SCCACHE_HOME:$PATH"
# Use Python 3.10 as default
RUN python3.10 -m venv venv
ENV PATH="/venv/bin:$PATH"
RUN alternatives --install /usr/bin/python python /usr/bin/python3.10 10
# Setup pip
ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.12 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}
# Install Node
ENV NODE_VERSION=21.7.3
ENV NVM_DIR=/.nvm
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
ENV PATH="$NVM_DIR/versions/node/v${NODE_VERSION}/bin/:${PATH}"
# To build git and curl from source
RUN dnf update -y && dnf install -y dh-autoreconf \
curl-devel \
expat-devel \
gettext-devel \
openssl-devel \
perl-devel \
zlib-devel \
libpsl-devel
# Build and install newer curl
RUN wget https://github.com/curl/curl/releases/download/curl-8_13_0/curl-8.13.0.tar.gz && \
tar -zxf curl-8.13.0.tar.gz
RUN cd curl-8.13.0 && \
./configure --prefix=/usr --with-openssl && \
make install
# Build and install newer git
RUN wget -O git-2.49.0.tar.gz https://github.com/git/git/archive/refs/tags/v2.49.0.tar.gz && \
tar -zxf git-2.49.0.tar.gz
RUN cd git-2.49.0 && \
make configure && ./configure --prefix=/usr && make install