-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.python
35 lines (32 loc) · 1.9 KB
/
Dockerfile.python
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
ARG BASE
FROM tinybases/${BASE} AS tinybases-python
# Install Python.
ARG VERSION
RUN cd /home \
&& pmm_remote=https://github.com/molinav/poorman-manager/archive/refs \
&& pmm_remote_pointer=tags \
&& pmm_remote_version=v0.8.0 \
&& wget ${pmm_remote}/${pmm_remote_pointer}/${pmm_remote_version}.tar.gz \
&& tar -xf ${pmm_remote_version}.tar.gz --strip 1 \
&& rm -f ${pmm_remote_version}.tar.gz \
&& cd bin \
&& chmod +x pmm \
&& ./pmm install bash \
&& if [ "${BASE}" = "debian:10" ]; then ./pmm install ncurses-base; fi \
&& if [ "${BASE}" = "debian:4" ]; then ./pmm install aptitude; fi \
&& ./pmm install gcc-full pyenv-dev pyenv \
&& ./pmm install python-${VERSION} \
&& ./pmm remove pyenv-dev gcc-full \
&& if [ "${BASE}" = "debian:4" ]; then ./pmm remove aptitude; fi \
&& cd .. \
&& rm -rf ./* \
&& unset pmm_remote \
&& unset pmm_remote_pointer \
&& unset pmm_remote_version
# Prepare Python environment.
ENV PYENV_ROOT=/opt/pyenv
ENV PATH=${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}
RUN pyenv global "$(pyenv versions | head -n1 | xargs)"
COPY files/etc/pip.conf /etc/pip.conf
# Launch shell.
CMD ["sh"]