-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.jupyterlab
70 lines (58 loc) · 2.62 KB
/
Dockerfile.jupyterlab
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
# Copyright (c) Nebari Development Team.
# Distributed under the terms of the Modified BSD License.
# Usage:
# ------
#
# To make a local build of the container, from the root directory:
# docker build -f Dockerfile.jupyterlab -t nebari-jupyterlab:latest .
ARG BASE_IMAGE=ubuntu:20.04
FROM $BASE_IMAGE
LABEL MAINTAINER="Nebari development team"
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN chmod -R a-w ~
COPY scripts/install-apt-minimal.sh /opt/scripts/install-apt-minimal.sh
RUN /opt/scripts/install-apt-minimal.sh
COPY scripts/fix-permissions /opt/scripts/fix-permissions
ENV MAMBAFORGE_VERSION 4.13.0-1
ENV MAMBAFORGE_AARCH64_SHA256 69e3c90092f61916da7add745474e15317ed0dc6d48bfe4e4c90f359ba141d23
ENV MAMBAFORGE_X86_64_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c
SHELL ["/bin/bash", "-c"]
ENV CONDA_DIR=/opt/conda \
DEFAULT_ENV=default
# Set timezone
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set PATH for Dockerfile so that conda works and some useful scripts are
# available. Any changes intended to propagate to runtime containers should be
# set in /etc/profile.d (see setup_shell_behavior.sh)
ENV PATH=/opt/conda/envs/${DEFAULT_ENV}/bin:/opt/conda/bin:${PATH}:/opt/scripts
# ============= base install ===============
# install conda
COPY scripts/install-conda.sh /opt/scripts/install-conda.sh
RUN echo "${SHELL}"; env; cat ~/.bashrc; cat ~/.profile ; /opt/scripts/install-conda.sh
# ========== jupyterlab install ============
COPY jupyterlab/apt.txt /opt/jupyterlab/apt.txt
COPY scripts/install-apt.sh /opt/scripts/install-apt.sh
RUN /opt/scripts/install-apt.sh /opt/jupyterlab/apt.txt
# Install extra packages (require custom package repository)
COPY scripts/install-gitlfs.sh /opt/scripts/install-gitlfs.sh
RUN /opt/scripts/install-gitlfs.sh
ARG SKIP_CONDA_SOLVE=no
COPY scripts/install-conda-environment.sh /opt/scripts/install-conda-environment.sh
COPY jupyterlab/environment.yaml /opt/jupyterlab/environment.yaml
RUN \
if [ "${SKIP_CONDA_SOLVE}" != "no" ];then \
ENV_FILE=/opt/jupyterlab/conda-linux-64.lock ; \
else \
ENV_FILE=/opt/jupyterlab/environment.yaml ; \
fi ; \
/opt/scripts/install-conda-environment.sh "${ENV_FILE}" 'true'
# ========== code-server install ============
ENV PATH=/opt/conda/envs/${DEFAULT_ENV}/share/code-server/bin:${PATH}
COPY scripts/install-code-server.sh /opt/scripts/install-code-server.sh
COPY jupyterlab /opt/jupyterlab
RUN /opt/jupyterlab/postBuild
# ========== Setup GPU Paths ============
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib64
ENV NVIDIA_PATH=/usr/local/nvidia/bin
ENV PATH="$NVIDIA_PATH:$PATH"