-
Notifications
You must be signed in to change notification settings - Fork 3
/
mojo.Dockerfile
56 lines (44 loc) · 1.59 KB
/
mojo.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
# Reference:
# https://github.com/modularml/mojo/blob/main/examples/docker/Dockerfile.mojosdk
# Use the base image based on Ubuntu 22.04
FROM ubuntu:22.04
# Set the default timezone argument
ARG DEFAULT_TZ=Asia/Shanghai
ENV DEFAULT_TZ=$DEFAULT_TZ
# Update package list and install basic utilities
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=$DEFAULT_TZ apt-get install -y \
tzdata \
vim \
nano \
sudo \
curl \
wget \
git && \
rm -rf /var/lib/apt/lists/*
# Download the latest version of minicoda py3.11 for linux x86/x64.
RUN curl -fsSL https://repo.anaconda.com/miniconda/$( wget -O - https://repo.anaconda.com/miniconda/ 2>/dev/null | grep -o 'Miniconda3-py311_[^"]*-Linux-x86_64.sh' | head -n 1) > /tmp/miniconda.sh \
&& chmod +x /tmp/miniconda.sh \
&& /tmp/miniconda.sh -b -p /opt/conda
ENV PATH=/opt/conda/bin:$PATH
RUN conda init
RUN pip install \
jupyterlab \
ipykernel \
matplotlib \
ipywidgets
# A random default token
ARG AUTH_KEY=5ca1ab1e
ENV AUTH_KEY=$AUTH_KEY
RUN curl https://get.modular.com | sh - && \
modular auth $AUTH_KEY
RUN modular install mojo
ARG MODULAR_HOME="/root/.modular"
ENV MODULAR_HOME=$MODULAR_HOME
ENV PATH="$PATH:$MODULAR_HOME/pkg/packages.modular.com_mojo/bin"
# Change permissions to allow for Apptainer/Singularity containers
RUN chmod -R a+rwX /root
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
# CMD ["jupyter", "lab", "--ip='*'", "--NotebookApp.token=''", "--NotebookApp.password=''","--allow-root"]
# Set the container startup command
CMD ["/bin/bash"]