forked from iluvatar1/IntroSciCompHPC-2024-1s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (83 loc) · 2.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# See docs : https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
FROM python:3.11-slim
LABEL maintainer="William Oquendo <woquendo@gmail.com>"
#ARG CACHEBUST=0 # reset cache at this point, change to 1 to reset cache
# Install packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc libffi-dev\
g++ \
gdb \
make \
cmake \
clang \
libeigen3-dev \
bat \
emacs-nox \
vim \
gnuplot-nox \
nano \
git \
htop \
curl \
unzip \
sudo \
tmux \
cpplint \
xfonts-100dpi \
ddd \
valgrind \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install the notebook package
RUN pip install --upgrade pip && \
pip install notebook jupyterlab
# Copy only the requirements file first
COPY requirements.txt .
# Install extra Python packages
RUN python3 -m pip install -r requirements.txt
# Install catch2
RUN git clone https://github.com/catchorg/Catch2.git
RUN cd Catch2 && \
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
sudo cmake --build build/ --target install --parallel $(nproc)
# Install fmt
RUN git clone https://github.com/fmtlib/fmt.git
RUN cd fmt && \
cmake -Bbuild -H. -DBUILD_SHARED_LIBS=TRUE -DFMT_TEST=OFF && \
sudo cmake --build build/ --target install --parallel $(nproc)
# Install starship to show git branch in prompt plus some other stuff
RUN curl -fsSL https://starship.rs/install.sh | sh -s -- -y
# Fix timezone
ENV TZ=America/Bogota
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set the SHELL environment variable to /bin/bash
ENV SHELL=/bin/bash
# create user with a home directory
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--shell /bin/bash \
--uid ${NB_UID} \
${NB_USER}
# Copy the rest of the files
COPY . ${HOME}
# Set ownership of files
USER root
RUN chown -R ${NB_UID} ${HOME}
WORKDIR ${HOME}
USER ${USER}
# Run matplotlib config to generate the font cache
RUN MPLBACKEND=Agg python3 -c "import matplotlib.pyplot"
# Setup starship
RUN echo 'eval "$(starship init bash)"' >> ${HOME}/.bashrc
# Fix permissions on .local
USER root
RUN mkdir ${HOME}/.local && \
chown -R ${NB_UID} ${HOME}/.local
USER ${USER}
## Clone the source code repo
#RUN git clone https://github.com/iluvatar1/2023-II-ProgCPP