-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (34 loc) · 1.56 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
FROM mambaorg/micromamba:2.0 as micromamba
FROM nvcr.io/nvidia/pytorch:24.10-py3
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV ENV_NAME=ml-venv
ENV MAMBA_USER=$ENV_NAME
ARG MAMBA_USER_ID=5005
ARG MAMBA_USER_GID=5005
ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"
EXPOSE 8888
USER root
COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
COPY --from=micromamba /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_initialize_user_accounts.sh /usr/local/bin/_dockerfile_initialize_user_accounts.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_setup_root_prefix.sh /usr/local/bin/_dockerfile_setup_root_prefix.sh
RUN /usr/local/bin/_dockerfile_initialize_user_accounts.sh && \
/usr/local/bin/_dockerfile_setup_root_prefix.sh
RUN apt update && apt install -y git tmux nvtop htop \
&& apt clean autoremove -y
USER $MAMBA_USER
SHELL ["/usr/local/bin/_dockerfile_shell.sh"]
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
RUN micromamba install -y -n base -c conda-forge python=3.12 \
&& micromamba clean --all --yes
WORKDIR /tmp
# Install any needed packages specified in environment.yml
COPY environment.yml environment.yml
RUN micromamba create -n $ENV_NAME -f environment.yml -y \
&& micromamba clean --all --yes
WORKDIR /workspace
ENV SHELL=/bin/bash
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--no-browser"]