forked from spacetelescope/jupyterhub-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
163 lines (130 loc) · 4.47 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# ================ vvvvv Generic Image vvvvv ==================
# If the image (jupyter/scipy-notebook) exists locally it will be used,
# otherwise the latest from https://hub.docker.com/_/buildpack-deps will be used
ARG BASE_IMAGE=stsci-jh/scipy-notebook
FROM $BASE_IMAGE
# ------------------------------------------------------------------------
LABEL maintainer="Science Platforms <dmd_octarine@stsci.edu>"
# Environment variables
ENV MKL_THREADING_LAYER="GNU"
# conda related env vars
ENV CONDA_DIR=/opt/conda
ENV SHELL=/bin/bash
ENV PATH=${CONDA_DIR}/bin:${PATH}
ENV CFLAGS="-fcommon"
# ------------------------------------------------------------------------
USER root
# Breaking into separate runs will build slower but also defines storage
# consumption in docker history.
#
# COPY common-scripts/apt-install /opt/common-scripts/apt-install
# Misc system tools
RUN /opt/common-scripts/apt-install \
tree \
curl \
wget \
rsync \
locales \
less \
ssh \
htop \
sysstat \
net-tools
# S/W Development Tools
RUN /opt/common-scripts/apt-install \
build-essential \
gfortran \
automake \
libtool \
make \
vim \
emacs-nox \
fftw3-dev \
libatlas-base-dev \
libcurl4-openssl-dev \
libxml2 \
libxml2-dev \
libxslt1.1 \
libxslt1-dev \
python-libxml2 \
python-dev \
python-setuptools \
graphviz \
libopenblas-dev
# X11 and DS9
RUN /opt/common-scripts/apt-install \
dbus-x11 \
xfce4 \
xfce4-panel \
xfce4-session \
xfce4-settings \
xorg \
xubuntu-icon-theme \
imagemagick \
gedit \
saods9
# Firefox ???
RUN /opt/common-scripts/apt-install \
firefox
# Libraries for FITS, DS9, ML
RUN /opt/common-scripts/apt-install \
file \
libcfitsio-bin \
libcfitsio-dev \
apt-file \
libxpa-dev \
libxt-dev \
libbz2-dev
# YYYY SEC
# nvidia-cuda-toolkit
# Latex
# RUN /opt/common-scripts/apt-install \
# texlive-latex-recommended \
# cm-super
# YYYY SEC
# RUN apt-get update && \
# apt-get remove --yes libpdfbox-java libfontbox-java && \
# apt autoremove --yes
# ------------------------------------------------------------------------
# This must be run after conda installs
RUN /opt/common-scripts/fix-certs
# ------------------------------------------------------------------------
# Remove light-locker to prevent screen lock
# BUG: get rid of --no-check-certificate
RUN wget https://sourceforge.net/projects/turbovnc/files/2.2.6/turbovnc_2.2.6_amd64.deb --no-check-certificate && \
dpkg -i turbovnc_2.2.6_amd64.deb && \
rm turbovnc_2.2.6_amd64.deb && \
apt-get remove -y -q light-locker
# ------------------------------------------------------------------------
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws
# ==================== Begin pip & conda installs =======================
USER root
# Load conda profile scripts by default, symlink target doesn't exist for a bit
RUN ln -s ${CONDA_DIR}/etc/profile.d/conda.sh /etc/profile.d/conda.sh
# ------------------------------------------------------------------------
USER root
# Keep Xfce directories out of home and set up shortcuts for DS9.
COPY user-dirs.defaults /etc/xdg/user-dirs.defaults
COPY --chown=${NB_UID}:${NB_GID} common-scripts/ /opt/common-scripts
COPY --chown=${NB_UID}:${NB_GID} common-env/ /opt/common-env
RUN cat /opt/common-scripts/global_bashrc >> /etc/bash.bashrc
# ----------------------------------------------------------------------
# Common conda environments
# USER ${NB_UID}
# COPY environments/ /opt/environments/
# ----------------------------------------------------------------------
# Set up astroquery and ds9 desktop short-cut, will be further
# augmented by specific deployments
USER ${NB_UID}
COPY default-home-contents/ /etc/default-home-contents
# ----------------------------------------------------------------------
# YYYY SEC
RUN npm set config set cafile /etc/ssl/certs/stsci-tls-ca-bundle.pem
RUN npm install -g --prod yarn && \
npm install -g --prod yarn-audit-fix && \
yarn config set cafile /etc/ssl/certs/stsci-tls-ca-bundle.pem && \
npm cache clean --force && \
yarn cache clean --force