-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathDockerfile
75 lines (52 loc) · 2.36 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
# this file is to host the official docker image of fastvpinns with python3 and tensorflow
# Download the base image for CUDA Libraries and cuDNN
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
# set up timezone
ENV TZ=Asia/Singapore \
DEBIAN_FRONTEND=noninteractive
# Run to setup Ascii Image Converter
RUN echo 'deb [trusted=yes] https://apt.fury.io/ascii-image-converter/ /' | tee /etc/apt/sources.list.d/ascii-image-converter.list
# Taken from https://stackoverflow.com/questions/56139706/speeding-up-apt-get-update-to-speed-up-docker-image-builds
# To Speedup image builds, replace the default ubuntu mirror with a faster mirror
RUN sed -i 's/htt[p|ps]:\/\/archive.ubuntu.com\/ubuntu\//mirror:\/\/mirrors.ubuntu.com\/mirrors.txt/g' /etc/apt/sources.list
# Install additional packages and restrict python version to be less than 3.11
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
python3-dev \
git \
# libGL Packages
libgl1-mesa-glx \
libglu1-mesa \
libglu1 \
# ascii-image-converter
ascii-image-converter
# git clone the official repository of fastvpinns
# RUN git clone https://github.com/cmgcds/fastvpinns.git
# Step 2: Create the destination directory
RUN mkdir /fastvpinns
# Step 3: Copy the contents of the fastvpinns folder to /fastvpinns
COPY . /fastvpinns
# Set the working directory to the cloned repository
WORKDIR /fastvpinns
# # Step 4: Print the current working directory and its contents
# RUN pwd && ls -la
# # Step 5: Print the contents of /fastvpinns directory
# RUN ls -la /fastvpinns
# open the requirements.txt file and replace the "tensorflow>=2.9.1,<=2.13.0" with "tensorflow>=2.9.1,<=2.11.0"
RUN sed -i 's/tensorflow>=2.9.1,<=2.13.0/tensorflow>=2.9.1,<=2.11.0/g' /fastvpinns/requirements.txt
# Set the PYTHONPATH environment variable
RUN pip install .
# add /fastvpinns to the current python path
ENV PYTHONPATH "${PYTHONPATH}:/fastvpinns"
# add this to bashrc
RUN echo "export PYTHONPATH=${PYTHONPATH}:/fastvpinns" >> ~/.bashrc
# set alias for python as python3 in bashrc
RUN echo "alias python=python3" >> ~/.bashrc
# Change execution permission
RUN chmod +x docker_initialise.py
# set bash as the default command
CMD ["/bin/bash"]
# Set the working directory to the cloned repository
WORKDIR /fastvpinns
ENTRYPOINT ["bash", "-c", "python3 /fastvpinns/docker_initialise.py && exec /bin/bash"]