-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
60 lines (46 loc) · 1.92 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
59
60
FROM ubuntu:16.04
ENV GDAL_DISABLE_READDIR_ON_OPEN=FALSE
MAINTAINER Tony Cannistra <[email protected]>
RUN apt-get update > /dev/null 2>&1 \
&& apt-get install -y software-properties-common curl > /dev/null 2>&1 \
&& apt autoremove -y > /dev/null 2>&1 \
&& apt-get update > /dev/null 2>&1\
&& apt-get install -y build-essential > /dev/null 2>&1
RUN apt-get -y update > /dev/null 2>&1 && apt-get install -y --no-install-recommends \
wget \
nginx \
bzip2 \
libgcc-5-dev \
ca-certificates > /dev/null 2>&1\
&& rm -rf /var/lib/apt/lists/*
RUN apt-get install -y software-properties-common > /dev/null 2>&1 \
&& add-apt-repository ppa:deadsnakes/ppa > /dev/null 2>&1 \
&& apt-get -y update > /dev/null 2>&1 \
&& apt-get install -y python3.6 > /dev/null 2>&1
RUN wget https://bootstrap.pypa.io/get-pip.py > /dev/null 2>&1 && python3.6 get-pip.py
RUN pip install setuptools > /dev/null 2>&1
# Anaconda
RUN wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh > /dev/null 2>&1
RUN bash Anaconda3-5.0.1-Linux-x86_64.sh -b > /dev/null 2>&1
RUN rm Anaconda3-5.0.1-Linux-x86_64.sh
ENV PATH /root/anaconda3/bin:$PATH
# Install dependancies
RUN apt-get update \
&& apt-get install -y libsm6 libxext6 libxrender-dev
COPY ./environment/pytorch_p36.yml /opt/program/
RUN conda env update -q --file /opt/program/pytorch_p36.yml
# AWS Credentials
COPY ./environment/aws_creds /root/.aws/credentials
COPY ./environment/aws_config /root/.aws/config
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
RUN apt-get install -y git > /dev/null 2>&1
SHELL ["/bin/bash", "-c"]
RUN echo "source activate pytorch_p36" > ~/.bashrc
ENV PATH="/opt/conda/envs/pytorch_p36/bin:${PATH}"
ENV PATH="/opt/program:${PATH}"
# Set up the program in the image
COPY ./environment/start.sh /opt/program
COPY ./model /opt/program
WORKDIR /opt/program
ENTRYPOINT ["/bin/bash", "start.sh"]