Bootstrap: docker
From: debian:buster

%files
    OpenFOAM-v1812.tgz /opt
    ThirdParty-v1812.tgz /opt

%post -c /bin/bash
    apt-get update
    apt-get install -y ca-certificates
    sed -i s/http:/https:/ /etc/apt/sources.list
    apt-get update
    apt-get upgrade -y
    #apt-get install -y openfoam openfoam-examples
    apt-get install -y build-essential flex bison cmake zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev qt4-dev-tools libqt4-dev libqt4-opengl-dev libqtwebkit-dev qtdeclarative5-dev qttools5-dev qt5-default libqt5x11extras5-dev libqt5help5 freeglut3-dev libscotch-dev libcgal-dev

    cd /opt
    mkdir OpenFOAM
    mv OpenFOAM-v1812.tgz ThirdParty-v1812.tgz OpenFOAM
    cd OpenFOAM
    tar -xzf OpenFOAM-v1812.tgz
    tar -xzf ThirdParty-v1812.tgz
    rm OpenFOAM-v1812.tgz
    rm ThirdParty-v1812.tgz

    source /opt/OpenFOAM/OpenFOAM-v1812/etc/bashrc
    export WM_NCOMPPROCS=4
    cd OpenFOAM-v1812
    ./Allwmake
    ./Allwmake
