diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a8703625 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:focal + +ENV DEBIAN_FRONTEND noninteractive + +ARG USER_ID +ARG GROUP_ID +RUN addgroup --gid $GROUP_ID flownet +RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID flownet + +RUN apt update && \ + apt install -y --no-install-recommends software-properties-common && \ + apt-add-repository ppa:opm/ppa -y && \ + apt-get update && \ + apt install -y --no-install-recommends \ + mpi-default-bin \ + libopm-simulators-bin \ + zlib1g-dev \ + libblas-dev liblapack-dev \ + libgl1 \ + git \ + python3-pip \ + python3-setuptools \ + python3-sphinx \ + python3-sphinx-rtd-theme \ + make \ + python3-ipython \ + python3-ipdb \ + black \ + pylint \ + libxrender1 \ + python3-pytest \ + libnss3-tools && \ + apt-get -y install -o Dpkg::Options::="--force-confold" sudo && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN adduser flownet sudo && \ + echo "flownet:docker" | chpasswd && \ + echo "flownet ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +USER flownet + +RUN echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc diff --git a/README.md b/README.md index be78605f..e156e524 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,18 @@ run jobs via LSF correctly you will need to update your default shell's configuration file (`.cshrc` or `.bashrc`) to automatically source your virtual environment. +It is also possible to use the provided docker file as +```bash +git clone git@github.com:equinor/flownet.git +docker build --tag=flownet-image --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --file=flownet/Dockerfile . +docker run -ti --mount "type=bind,src=$(pwd),dst=/home/flownet/shared" --workdir="/home/flownet/shared" flownet-image +``` +In the docker container, install flownet as above by +```bash +cd flownet +pip install -e . +``` + ### Running FlowNet You can run _FlowNet_ as a single command line: