This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (50 loc) · 1.9 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
61
62
63
64
# Remove all stopped Docker containers: sudo docker rm $(sudo docker ps -a -q)
# Remove all untagged images: sudo docker rmi $(sudo docker images -q --filter "dangling=true")
# My NVIDIA driver supports only cuda <= 9.0
# FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu18.04
FROM nvidia/cuda:9.0-base-ubuntu16.04
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
git \
sudo \
software-properties-common \
vim \
emacs \
wget
# Sometimes needed to avoid SSL CA issues.
RUN update-ca-certificates
ENV HOME /home
WORKDIR ${HOME}/
# Download Miniconda
RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
chmod +x miniconda.sh && \
./miniconda.sh -b -p ${HOME}/miniconda3 && \
rm miniconda.sh
# Setting these env var outside of the install script to ensure
# they persist in image
# (See https://stackoverflow.com/questions/33379393/docker-env-vs-run-export)
ENV PATH ${HOME}/miniconda3/bin:$PATH
ENV CONDA_PATH ${HOME}/miniconda3
ENV LD_LIBRARY_PATH ${CONDA_PATH}/lib:${LD_LIBRARY_PATH}
# Set JAVA_HOME for Spark
ENV JAVA_HOME ${HOME}/miniconda3
# Install Spark for Horizon
RUN wget https://archive.apache.org/dist/spark/spark-2.3.3/spark-2.3.3-bin-hadoop2.7.tgz && \
tar -xzf spark-2.3.3-bin-hadoop2.7.tgz && \
mv spark-2.3.3-bin-hadoop2.7 /usr/local/spark && \
rm spark-2.3.3-bin-hadoop2.7.tgz
# Add files to image
ADD ./config drl-frameworks/config
ADD ./scripts drl-frameworks/scripts
ADD ./lib drl-frameworks/lib
ADD ./scripts/docker/on_start.sh /usr/local/bin/on_start.sh
# Set up project environment
WORKDIR ${HOME}/drl-frameworks
RUN bash ./scripts/docker/setup_docker_env.sh
RUN chmod 777 /usr/local/bin/on_start.sh
RUN find ${CONDA_PATH} -type d -exec chmod 777 {} \;
# Define default command.
CMD /usr/local/bin/on_start.sh