-
Notifications
You must be signed in to change notification settings - Fork 34
/
Dockerfile
87 lines (66 loc) · 3.44 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
#*******************************************************************************
#Dockerfile
#*******************************************************************************
#Purpose:
#This file describes the operating system prerequisites for RAPID, and is used
#by the Docker software.
#Author:
#Cedric H. David, 2018-2024.
#*******************************************************************************
#Usage
#*******************************************************************************
#docker build -t ubuntu:rapid -f Dockerfile . #Create image
#docker run --rm --name ubuntu_rapid -it ubuntu:rapid #Run image in container
#docker save -o ubuntu_rapid.tar ubuntu:rapid #Save a copy of image
#docker load -i ubuntu_rapid.tar #Load a saved image
#*******************************************************************************
#Operating System
#*******************************************************************************
FROM debian:11.7-slim
#*******************************************************************************
#Copy files into Docker image (this ignores the files listed in .dockerignore)
#*******************************************************************************
WORKDIR /home/rapid/
COPY . .
#*******************************************************************************
#Operating System Requirements
#*******************************************************************************
RUN apt-get update && \
apt-get install -y --no-install-recommends $(grep -v -E '(^#|^$)' requirements.apt) && \
rm -rf /var/lib/apt/lists/*
#*******************************************************************************
#Other Software Requirements
#*******************************************************************************
#-------------------------------------------------------------------------------
#Install other software
#-------------------------------------------------------------------------------
ENV INSTALLZ_DIR=/home/installz
#Directory where software is installed
RUN mkdir $INSTALLZ_DIR && \
./rapid_install_prereqs.sh -i=$INSTALLZ_DIR
#-------------------------------------------------------------------------------
#Update environment (ENV variables are available in Docker images & containers)
#-------------------------------------------------------------------------------
ENV NETCDF_LIB='-L /usr/lib -lnetcdff'
ENV NETCDF_INCLUDE='-I /usr/include'
#netCDF
ENV PETSC_DIR=$INSTALLZ_DIR/petsc-3.13.6
ENV PETSC_ARCH=linux-gcc-c
ENV PATH=$PATH:$PETSC_DIR/$PETSC_ARCH/bin
#PETSc
#*******************************************************************************
#Build RAPID
#*******************************************************************************
RUN cd ./src/ && \
make rapid && \
cd ../tst/ && \
gfortran -o tst_run_comp tst_run_comp.f90 $NETCDF_INCLUDE $NETCDF_LIB && \
gfortran -o tst_run_cerr tst_run_cerr.f90 $NETCDF_INCLUDE $NETCDF_LIB && \
gfortran -o tst_run_conv_Qinit tst_run_conv_Qinit.f90 $NETCDF_INCLUDE $NETCDF_LIB
#*******************************************************************************
#Intended (default) command at execution of image (not used during build)
#*******************************************************************************
CMD /bin/bash
#*******************************************************************************
#End
#*******************************************************************************