-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·72 lines (57 loc) · 1.99 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
FROM nvidia/cuda:12.3.2-runtime-ubuntu22.04
ARG PYTHON_VERSION=3.12.0
ARG JULIA_VERSION=1.10.2
ENV container docker
ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.utf8
ENV MAKEFLAGS -j4
RUN mkdir /app
WORKDIR /app
# necessary deps
RUN apt-get update -y && \
apt-get install -y gcc make wget cmake curl git zlib1g-dev libffi-dev libssl-dev python-pip bash tar g++-10
# python
RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \
tar -zxf Python-$PYTHON_VERSION.tgz && \
cd Python-$PYTHON_VERSION && \
./configure --with-ensurepip=install --enable-shared --enable-loadable-sqlite-extensions --enable-optimizations && make && make install && \
ldconfig && \
ln -sf python3 /usr/local/bin/python
# poetry
RUN curl -sSL https://install.python-poetry.org | python -
ENV PATH=$PATH:/root/.local/bin
RUN poetry config virtualenvs.create true
# julia
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.2-linux-x86_64.tar.gz && \
tar -xvzf julia-1.10.2-linux-x86_64.tar.gz -C /usr/local/ && \
ln -s /usr/local/julia-1.10.2/bin/julia /usr/local/bin/julia && \
mkdir -p /usr/local/include/julia && \
cp -r /usr/local/julia-1.10.2/include/julia /usr/local/include/ && \
ln -s /usr/local/lib /usr/local/julia-1.10.2/lib
RUN ls -la /usr/local/include/julia
RUN ls -la /usr/local/
COPY . .
# install py deps
RUN cd py_src && \
poetry lock && \
poetry install && \
cd ..
# setup cpp
RUN cd cpp_src && \
rm -rf CMakeFiles && \
rm -f cmake_install.cmake && \
rm -f CMakeCache.txt && \
rm -f Makefile && \
bash install_deps.sh
# setup ctest
RUN apt-get update && apt-get install -y libgtest-dev cmake && \
cd /usr/src/gtest && \
cmake . && \
make && \
cp lib/*.a /usr/lib
# install sudo
RUN apt-get install -y sudo
# remove install files
RUN rm -rf Python-$PYTHON_VERSION.tgz Python-$PYTHON_VERSION julia-1.10.2-linux-x86_64.tar.gz cuda-*
# enter vm
CMD ["/bin/bash"]