From becb520d9f10f70ef78aef1694e92b5c80181087 Mon Sep 17 00:00:00 2001 From: jkowalsk <jerome.kowalski@inria.fr> Date: Tue, 28 Feb 2023 10:59:42 +0100 Subject: [PATCH] add dockerfile and update readme --- README.md | 14 +++++++++ docker/Dockerfile.dev | 72 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 docker/Dockerfile.dev diff --git a/README.md b/README.md index 57dbcd2..2837ff8 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,17 @@ done $COMMAND ``` + +## Develop in a container + +To build the docker development image (from the same directory than this `README.md`): +```terminal +docker build -f ./docker/Dockerfile.dev -t dce-mri_dev . +``` +This will create a docker image with tag `dce-mri_dev`. You can check that the image is indeed created by running `docker image ls -a`. + +To run the created docker image: +```terminal +docker run -i -t --network host dce-mri_dev --mount type=bind,source="($pwd)"/sources,target=/source +``` +You can then develop, compile and run your changes with the required packages. \ No newline at end of file diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 0000000..89410ad --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,72 @@ +FROM ubuntu:22.04 + +LABEL build-date="2023-01-12" +LABEL name="base-ubuntu-22.04" +LABEL description="Ubuntu 22.04 Focal Jammy Jellyfish for developing Vascularization and VascularizationInverse codes with the necessary libraries." +LABEL vsc-url="https://gitlab.inria.fr/simbiotx/dyna-imaging-mod" +LABEL version=1.0.0 + +#Prepare tzdata - set timezone to Paris +RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime + +#Set the frontend non-interactive +ENV DEBIAN_FRONTEND noninteractive + +#Upgrade and install dependencies +# - build-essential +# - gcc +# - git +# - libtool +# - linux-tools-common +#OpenMP: +# - libomp-dev +#XML: +# - libtinyxml-dev +#PNG: +# - libpng-dev +#Editor: +# - vim +#Other: +# - autoconf +# - automake +# - libgsl-dev +# - zlib1g-dev + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y \ + autoconf\ + automake\ + build-essential \ + gcc \ + git \ + libgsl-dev \ + libomp-dev \ + libpng-dev \ + libx11-dev\ + libtool\ + linux-tools-common \ + vim \ + zlib1g-dev \ + && apt-get clean + +#Build the code +# libnix: library utility used by Vascularization and VascularizationInverse +RUN mkdir source + +COPY ./sources/libnix /source/libnix +# Install libnix +RUN cd /source/libnix\ + && autoreconf -f -i\ + && ./configure\ + && make\ + && make install + +# Clean the directory +RUN mkdir /build\ + && mkdir /Output + +# Set the library path +RUN echo "LD_LIBRARY_PATH=/usr/local/lib/\n export LD_LIBRARY_PATH" >> ~/.bashrc + +CMD "/bin/bash" -- GitLab