diff --git a/README.md b/README.md index 57dbcd2e64c4730ee59b8274c10e4f80f3b78482..2837ff8898ec31cf2f3d91fcaf28011bf134ce27 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 0000000000000000000000000000000000000000..89410adc6a0c242ff4d411e9ab6732240c06cf44 --- /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"