Skip to content

Docker Installation and Setup for Task 4

Overview

This guide explains how to build and run the Docker container that provides a virtualized environment for Task 4 of the Scientific Computing for Physics Students project. The container is based on AlmaLinux9 and includes all required development tools and libraries (yaml-cpp, HDF5, GSL, etc.), as well as a Python environment managed by Miniconda.

Prerequisites

  • Docker must be installed.
  • Follow the Docker installation instructions in TaskĀ 1 before proceeding with TaskĀ 4.

Building the Docker Image

The Dockerfile is located in the docker/ directory and is named Dockerfile.alma9.

  1. Open a terminal and navigate to the project root.
  2. Run the following command to build the Docker image:

    docker build -t sci-comp-task4 -f docker/Dockerfile.alma9 .
    
    1. -t sci-comp-task4 tags the image with the name sci-comp-task4.
    2. -f docker/Dockerfile.alma9 specifies the location of the Dockerfile.
    3. The final . sets the build context to the project root.

Running the Docker Container

Once the image is built, you can start a container interactively with:

docker run -it -v "$(pwd):/workspace" sci-comp-task4
  • -it: Runs the container in interactive mode with a TTY.
  • -v "$(pwd):/workspace": Mounts the current project root into the container at /workspace.
  • sci-comp-task4: Specifies the image name.

Inside the container, your working directory will be /workspace (which is your project root), and all necessary tools and libraries will be available.