forked from aidotse/PASEOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (37 loc) · 1.38 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
FROM ubuntu:22.10
ARG CONDA_PYTHON_VERSION=3
ARG USERNAME=user
ARG HOME=/home/user
ARG CONDA_DIR=$HOME/conda
ARG USERID=1000
# Create the user
RUN useradd --create-home -s /bin/bash --no-user-group -u $USERID $USERNAME
# Instal basic utilities
RUN apt-get update && \
apt-get install -y --no-install-recommends git wget unzip bzip2 sudo build-essential ca-certificates && \
apt-get install libsm6 libxext6 -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
## Install miniconda
ENV PATH $CONDA_DIR/bin:$PATH
RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda$CONDA_PYTHON_VERSION-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
echo 'export PATH=$CONDA_DIR/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash /tmp/miniconda.sh -b -p $CONDA_DIR && \
rm -rf /tmp/*
RUN chown $USERNAME $HOME -R && \
adduser $USERNAME sudo && \
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER $USERNAME
WORKDIR /home/$USERNAME/paseos
# copy all files.
COPY . $HOME/paseos
# Install mamba
RUN conda install -y mamba -c conda-forge
RUN mamba env update --file environment.yml --name base
# For interactive shell
SHELL ["/bin/bash", "-c"]
RUN echo ". activate base" >> $HOME/.bashrc && \
chmod u+x $HOME/.bashrc && \
$HOME/.bashrc && \
pip install -e . --no-dependencies --ignore-requires-python
ENV PATH $HOME/conda/envs/env/bin:$PATH