-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_rocky_8
62 lines (51 loc) · 2.28 KB
/
Dockerfile_rocky_8
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
FROM rockylinux:8 as builder
LABEL maintainer="Ingo Meyer <[email protected]>"
ENV PYENV_ROOT "/usr/local/pyenv"
ENV PATH "${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
ENV LANG C.UTF-8
RUN dnf install -y bzip2-devel \
ca-certificates \
curl \
libffi-devel \
ncurses-devel \
openssl-devel \
readline-devel \
sqlite-devel \
xz-devel \
zlib-devel && \
dnf groupinstall -y "Development Tools" && \
dnf clean all
RUN curl -o "/tmp/pyenv-master.tar.gz" -L "https://github.com/pyenv/pyenv/archive/master.tar.gz" && \
tar -C /tmp/ -xvf "/tmp/pyenv-master.tar.gz" && \
mv "/tmp/pyenv-master" "${PYENV_ROOT}"
RUN if [ ! -d "${PYENV_ROOT}/plugins/python-build/share/python-build/patches/3.3.7" ]; then \
cp -r "${PYENV_ROOT}/plugins/python-build/share/python-build/patches/3.3.6" "${PYENV_ROOT}/plugins/python-build/share/python-build/patches/3.3.7" && \
mv "${PYENV_ROOT}/plugins/python-build/share/python-build/patches/3.3.7/Python-3.3.6" "${PYENV_ROOT}/plugins/python-build/share/python-build/patches/3.3.7/Python-3.3.7"; \
fi
RUN set -e; \
installed_python_versions=""; \
for version in 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \
latest_version="$(pyenv install --list | awk "NR > 1 && \$1 ~ /^$(echo "${version}" | sed 's/\./\\./g')(\.[0-9.]*)?(-dev)?$/" | tail -1 | tr -d ' ')"; \
pyenv install "${latest_version}"; \
installed_python_versions="${latest_version} ${installed_python_versions}"; \
done; \
pyenv global ${installed_python_versions}
RUN pip install -U pip && \
pip install tox
FROM rockylinux:8
ENV PYENV_ROOT "/usr/local/pyenv"
ENV PATH "${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
RUN dnf install -y bzip2 \
ca-certificates \
libffi \
ncurses \
openssl \
readline \
sqlite \
xz \
zlib && \
dnf clean all
COPY --from=builder "${PYENV_ROOT}" "${PYENV_ROOT}"
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/bin/bash"]