-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalmond.Dockerfile
More file actions
77 lines (63 loc) · 2.86 KB
/
almond.Dockerfile
File metadata and controls
77 lines (63 loc) · 2.86 KB
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
71
72
73
74
75
76
77
# Use the official Python 3.12 image as the base
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
USER root
# Install lsb-release to get the codename
RUN apt update && apt install -y lsb-release
# Get the codename and update the APT sources list
RUN CODENAME=$(lsb_release -cs) && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME main universe" > /etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME-updates main universe" >> /etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME-security main universe" >> /etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME multiverse" >> /etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME-updates multiverse" >> /etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ $CODENAME-security multiverse" >> /etc/apt/sources.list
# Update package lists
RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:deadsnakes/ppa -y
# Install required packages
RUN apt-get update && apt-get install -y \
software-properties-common \
gcc \
g++ \
curl \
unzip \
wget \
python3.11 \
openjdk-11-jdk
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
RUN apt install -y make graphviz git cmake libcgal-dev
RUN apt-get update && apt-get install -y \
curl \
openjdk-11-jdk
# Install CUDA toolkit
RUN wget --quiet https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin
RUN mv cuda-ubuntu2404.pin /etc/apt/preferences.d/cuda-repository-pin-600
RUN wget --quiet https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda-repo-ubuntu2404-12-8-local_12.8.1-570.124.06-1_amd64.deb
RUN dpkg -i cuda-repo-ubuntu2404-12-8-local_12.8.1-570.124.06-1_amd64.deb
RUN cp /var/cuda-repo-ubuntu2404-12-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
RUN apt-get update && \
apt-get -y install cuda-toolkit-12-8
# Set environment variables for CUDA
ENV PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
# Install Jupyter
RUN python3.11 -m pip install --no-cache-dir jupyter
# Install Scala and Almond
RUN curl -Lo coursier https://git.io/coursier-cli && \
chmod +x coursier && \
./coursier bootstrap almond:0.13.14 --scala 2.13 -o almond && \
./almond --install
# Install requirements.txt
COPY requirements.txt /main/requirements.txt
RUN python3.11 -m pip install setuptools
RUN python3.11 -m pip install -r /main/requirements.txt
RUN rm -rf /usr/bin/python3.10
RUN update-alternatives --remove python /usr/bin/python3.10
# Create symlinks for python and pip
RUN ln -s /usr/bin/python3.11 /usr/bin/python && \
ln -s /usr/local/bin/pip /usr/bin/pip
# Expose the port for JupyterLab
EXPOSE 8888
# Command to launch JupyterLab
CMD ["jupyter-lab", "--ip=0.0.0.0", "--no-browser", "--allow-root", "--NotebookApp.token=''"]