-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile
90 lines (81 loc) · 3.39 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# syntax = docker/dockerfile:1.0-experimental
FROM pytorch/pytorch:1.8.1-cuda11.1-cudnn8-runtime
# working directory
WORKDIR /workspace
# ---------------------------------------------
# Project-agnostic System Dependencies
# ---------------------------------------------
RUN \
# Install System Dependencies
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
wget \
unzip \
psmisc \
vim \
git \
ssh \
curl \
lshw \
ubuntu-drivers-common \
ca-certificates \
libjpeg-dev \
libpng-dev && \
rm -rf /var/lib/apt/lists/* && \
# Install NVIDIA Driver
# https://www.linuxbabe.com/ubuntu/install-nvidia-driver-ubuntu-18-04
# ubuntu-drivers autoinstall && \
# https://serverfault.com/questions/227190/how-do-i-ask-apt-get-to-skip-any-interactive-post-install-configuration-steps
# https://stackoverflow.com/questions/38165407/installing-lightdm-in-dockerfile-raises-interactive-keyboard-layout-menu
# apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# nvidia-driver-440 && \
# rm -rf /var/lib/apt/lists/* && \
# Install NodeJS
# https://github.com/nodesource/distributions/blob/master/README.md#deb
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs
# ---------------------------------------------
# Project-specific System Dependencies
# ---------------------------------------------
RUN \
# Clone the Apex Module (this requires torch)
# git clone https://github.com/NVIDIA/apex /workspace/apex && \
# cd /workspace/apex && \
# pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ && \
# Install Graphviz
apt-get update && apt-get install -y --no-install-recommends \
graphviz && \
rm -rf /var/lib/apt/lists/*
# ---------------------------------------------
# Build Python depencies and utilize caching
# ---------------------------------------------
COPY ./requirements.txt /workspace/soft-Q-learning/requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /workspace/soft-Q-learning/requirements.txt && \
# Jupyter Extensions (https://plot.ly/python/getting-started/):
# Avoid "JavaScript heap out of memory" errors during extension installation (OS X/Linux)
export NODE_OPTIONS=--max-old-space-size=4096 && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build && \
# jupyter labextension install @oriolmirosa/jupyterlab_materialdarker --no-build && \
jupyter lab build && \
# Unset NODE_OPTIONS environment variable (OS X/Linux)
unset NODE_OPTIONS
# upload everything
COPY . /workspace/soft-Q-learning/
# Set HOME
ENV HOME="/workspace/soft-Q-learning"
# ---------------------------------------------
# Project-agnostic User-dependent Dependencies
# ---------------------------------------------
RUN \
# Install Awesome vimrc
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime && \
sh ~/.vim_runtime/install_awesome_vimrc.sh && \
# NLTK
python -m nltk.downloader punkt
# Reset Entrypoint from Parent Images
# https://stackoverflow.com/questions/40122152/how-to-remove-entrypoint-from-parent-image-on-dockerfile/40122750
ENTRYPOINT []
# load bash
CMD /bin/bash