-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
42 lines (34 loc) · 1.28 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
# Choose the base image from to take.
# Using slim images is best practice
FROM ubuntu:latest
ARG PYTHON_VERSION=3.6
ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# This is one of the best practice.
# This technique is known as “cache busting”.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
apt-utils \
build-essential \
cmake \
git \
curl
# add non-root user
RUN useradd --create-home --shell /bin/bash containeruser
USER containeruser
WORKDIR /home/containeruser
# install miniconda and python
RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /home/containeruser/conda && \
rm ~/miniconda.sh && \
/home/containeruser/conda/bin/conda clean -ya && \
/home/containeruser/conda/bin/conda install -y python=$PYTHON_VERSION
# add conda to path
ENV PATH /home/containeruser/conda/bin:$PATH
# Now install this repo
# We need only the master branch not all branches
COPY requirements.txt requirements.txt
COPY requirements-test.txt requirements-test.txt
RUN pip install -r requirements.txt && \
pip install -r requirements-test.txt