forked from NBISweden/project_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.conda
58 lines (46 loc) · 1.39 KB
/
Dockerfile.conda
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
FROM ubuntu:20.04
LABEL description = "Lightweight image with Conda, Jupyter Notebook and Nextflow"
# Install Miniconda3 and prerequisites
RUN apt-get update --yes && apt-get upgrade --yes && \
apt-get install -y --no-install-recommends \
bzip2 \
build-essential \
ca-certificates \
curl \
git \
openssh-client \
vim
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh -O && \
bash Miniconda3-py39_4.11.0-Linux-x86_64.sh -bf -p /opt/miniconda3/ && \
rm Miniconda3-py39_4.11.0-Linux-x86_64.sh
# Use bash as shell
SHELL ["/bin/bash", "-c"]
# Add Conda to PATH
ENV PATH="/opt/miniconda3/bin:$PATH"
ARG PATH="/opt/miniconda3/bin:$PATH"
# Set up the Conda environment
COPY environment.yaml .
RUN conda env create -n dev -f environment.yaml && \
conda clean --all && \
conda init bash && \
source /root/.bashrc
# Set default user to UID 1000
# ENV NB_USER nbuser
# ENV NB_UID 1000
# RUN adduser --disabled-password --no-create-home \
# --gecos "Default user" \
# --uid ${NB_UID} \
# ${NB_USER}
# Define workdir and set ownership to NB_USER
# WORKDIR /home/${NB_USER}
# ENV HOME /home/${NB_USER}
# USER root
# RUN chown -R ${NB_UID} ${HOME}
# USER ${NB_USER}
# Setup conda environment
# RUN conda init bash && \
# source .bashrc && \
# conda activate dev
EXPOSE 8888
# Start Bash shell by default
CMD /bin/bash