You can run containers in an M3 cluster, but not through Docker. Instead, use Apptainer (formerly known as Singularity).
Apptainer is similar to Docker but is more suitable for HPC environments out of the box. You can run almost all Docker images without any problems by just using Apptainer.
Read more about Apptainer here.
With Apptainer (formerly Singularity), you can pull Docker Hub images or build an image from a definition file.
Here, we will show you the most common commands you need to start using Apptainer.
Most of the logic applied to Docker containers and Dockerfile syntax also applies to Apptainer. Some differences are mentioned at the end of this documentation.
To directly pull a Docker image from Docker Hub using Apptainer, follow these examples:
apptainer pull docker://python:3.9.19-slim
# Please note the 'docker://' at the beginning of the image name.
This command pulls the "python:3.9.19-slim" image from Docker Hub and converts/saves it to a Singularity Image Format (SIF) image on the host filesystem.
apptainer shell docker://python:3.9.19-slim
This command opens an interactive shell within the "python:3.9.19-slim" image.
apptainer run docker://python:3.9.19-slim
This command runs an Apptainer container using the "python:3.9.19-slim" image from Docker Hub.
apptainer exec docker://python:3.9.19-slim python --version
This command runs the python --version
command inside the "python:3.9.19-slim" image.
apptainer build python_3.9.19-slim.sif docker://python:3.9.19-slim
This command builds a Singularity format image from the "python:3.9.19-slim" image from Docker Hub and saves it to the local filesystem as python_3.9.19-slim.sif
.
These commands display help information for Apptainer options and subcommands.
# Shows the general help information for Apptainer.
apptainer help
# Provides help details for the 'run' subcommand in Apptainer.
apptainer help run