This repository contains the presentation and examples presented in the "Docker Seminar" on February 8th by Alberto Maillo.
This guide provides instructions for building, running, uploading to Docker Hub, and downloading from Docker Hub for an R script (download folder example1).
To build the Docker image, run the following command in the terminal (the "." should be specified the path of the Dockerfile, the dot represents the current directory):
docker build -t <image_name> . --progress=plain . &> build.log
To generate output files, mount the current directory or another directory of the host machine to the /output/ folder using the following command:
docker run -v "path:/output" <image_name>
To upload the Docker image to Docker Hub, follow these steps:
- Tag the image with your Docker Hub username and repository name:
docker tag <image_id> <username>/<repository_name>:<tag>
- Log in to Docker Hub (insert your credentials):
docker login
- Push the tagged image to Docker Hub:
docker push <username>/<repository_name>:<tag>
To download the Docker image from Docker Hub, use the following commands:
docker pull <username>/<repository_name>
- Show all containers:
docker ps -a
- Remove a container:
docker rm -f <container_id>
- Remove an image:
docker image rm <image_id>
This guide provides instructions for using Singularity on Ibex, including building and running Singularity images. (download folder example2).
ssh <username>@ilogin.ibex.kaust.edu.sa
To build a Singularity image on Ibex, follow these steps:
- Use the
singularity build
command with the--fakeroot
and--force
options to create the image:
singularity build --fakeroot --force <image>.sig <image>.def
To run the Singularity image on Ibex, execute the following command:
singularity run <image>.sig
To create a bash script containing the Singularity run command and execute it using Slurm, see example script.sh:
sbatch script.sh