Skip to content

Instantly share code, notes, and snippets.

@mgnisia
Last active June 4, 2019 09:22
Show Gist options
  • Save mgnisia/ce20e4e49e76c586c953019b1974723a to your computer and use it in GitHub Desktop.
Save mgnisia/ce20e4e49e76c586c953019b1974723a to your computer and use it in GitHub Desktop.
Dockerfile for preCICE, OpenFOAM and the preCICE openFOAM Adapater
# Selecting the Operating System
FROM ubuntu:18.04
# Updating
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install wget git gnupg gnupg2 gnupg1 software-properties-common vim
RUN sh -c "wget -qO - http://dl.openfoam.org/gpg.key | apt-key add -"
# Setup OpenFoam
RUN add-apt-repository http://dl.openfoam.org/ubuntu
RUN apt-get update
RUN apt-get -y install openfoam5
RUN echo "source /opt/openfoam5/etc/bashrc" > ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
RUN apt-get -y install build-essential cmake libeigen3-dev libxml2-dev petsc-dev libboost-all-dev python-dev python-numpy
# Preparing the open foam adapter
# install yaml cpp
RUN git clone https://github.com/jbeder/yaml-cpp.git
WORKDIR yaml-cpp
WORKDIR build
RUN cmake -DBUILD_SHARED_LIBS=ON ..
RUN make && make install
# Install precice
WORKDIR /
RUN wget https://github.com/precice/precice/releases/download/v1.5.0/libprecice1.5.0-bionic.deb
RUN dpkg -i libprecice1.5.0-bionic.deb
# Open Foam Adapter
RUN git clone https://github.com/precice/openfoam-adapter.git
WORKDIR openfoam-adapter
RUN mkdir cases
RUN ["/bin/bash", "-c", "source ~/.bashrc; ./Allwmake"]
# Installting FISH
RUN apt-get install -y fish
WORKDIR /
ENTRYPOINT ["fish"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment