Using a Docker Image for DevelopmentΒΆ

If you haven't used Docker before, it is recommended that you check out the Docker tutorial before proceeding.

  1. Clone a copy of the Serac repo to your computer: git clone --recursive https://github.com/LLNL/serac.git

  2. Once you've installed docker, navigate to our Dockerhub page and select the most recent image corresponding to the compiler you'd like to use. Clang 14 and GCC 13 images are currently offered.

  3. Copy the pull command corresponding to the image you've selected (in this case, it's docker pull seracllnl/tpls:clang-14_latest):

../../_images/copy_pull_cmd.png
  1. Next, run the copied command. Our images are around 4 GB, so it may take a while for the image to be downloaded to your machine. When the download completes, you will see something like the following:

../../_images/pull_complete.png
  1. You can now run the image. Run docker run -it -u serac -v /your/serac/repo:/home/serac/serac seracllnl/tpls:clang-14_latest /bin/bash, replacing the tag (the compiler name following the tpls:) with the tag you used in the docker pull command and replacing /your/serac/repo with the path to the Serac repo you cloned in the first step. This will open a terminal into the image.

Note

The -v option to docker run mounts a Docker volume into the container. This means that part of your filesystem (in this case, your copy of the Serac repo) will be accessible from the container.

  1. Follow the build instructions detailed in the quickstart guide, using the host-config in host-configs/docker that corresponds to the compiler you've selected. These commands should be run using the terminal you opened in the previous step. Due to issues with the docker bind-mount permissions, it is suggested that you set the build and install directories to be outside of the repository.

    $ cd /home/serac/serac
    $ python ./config-build.py -hc host-configs/docker/<container-host-config>.cmake -bp ../build -ip ../install
    $ cd ../build
    $ make -j4
    $ make test
    
  2. You can now make modifications to the code from your host machine (e.g., via a graphical text editor), and use the Docker container terminal to recompile/run/test your changes.