macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Restart your terminal after installation, then verify:
uv --versionuv venv --python 3.12This creates a .venv directory in the current folder.
macOS / Linux:
source .venv/bin/activateWindows:
.venv\Scripts\activatepython compute_test.pyMN5 has no internet access, so containers must be built locally and transferred.
Scripts live outside the container and are mounted at runtime — only dependencies are baked in.
The Dockerfile is the only container file you need — myenv.def is kept for reference only.
The full workflow is:
Dockerfile → docker build (macOS) → docker save → scp to MN5 → apptainer build → myenv.sif
Scripts live outside the container and are mounted at runtime — only dependencies are baked into the image.
# Build the Docker image for MN5 (amd64 architecture)
docker build --platform linux/amd64 -t myenv .docker save myenv -o myenv.tarOnly the tarball needs transferring — scripts can be copied separately or edited directly on MN5.
scp myenv.tar user@mn5.bsc.es:/path/to/project/
scp -r scripts/ user@mn5.bsc.es:/path/to/project/# Load the Singularity module
module load singularity
# Convert the Docker tar to a Singularity image (no internet needed)
singularity build myenv.sif docker-archive://myenv.tar# Mount the local scripts directory and run
singularity run --bind $(pwd)/scripts:/opt/scripts myenv.sif /opt/scripts/compute_test.py