-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
59 lines (46 loc) · 1.58 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
FROM ubuntu:20.04
ARG BUILDER_UID=9999
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Australia/Hobart
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH /home/builder/.local/bin:$PATH
ENV PYTHON_VERSION 3.8.13
RUN apt-get update && \
apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:rael-gc/rvm && apt-get update
RUN apt-get install -y --no-install-recommends \
ca-certificates \
git \
libmagic1 \
libudunits2-dev \
python3-dev \
# Pyenv pre-requisites (from https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Set-up necessary Env vars for PyEnv
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
# Install pyenv
RUN set -ex \
&& curl https://pyenv.run | bash \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pyenv rehash \
&& chmod -R a+w $PYENV_ROOT/shims
RUN pip install --upgrade pip==22.1.2 setuptools==63.1.0 wheel build
RUN pip install \
Cython==0.29.30 \
bump2version==1.0.1 \
sphinx==5.0.2 \
sphinx_rtd_theme==1.0.0 \
numpy==1.23.0 \
setuptools-scm==7.0.4
RUN useradd --create-home --no-log-init --shell /bin/bash --uid $BUILDER_UID builder
USER builder
WORKDIR /home/builder
# Optional : Checks Pyenv version on container start-up
# ENTRYPOINT [ "pyenv","version" ]