/tools-plugin:apptainerfrom tools-plugin
Runs OCI/Docker images as rootless batch jobs with GPU passthrough on Linux. Use when Docker is unavailable, podman lacks GPU support, or running CUDA tools without root.
Ships in tools-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run a container image as one batch command — a CUDA tool that reads files,
writes files and exits — on a Linux host, without a daemon and without root.
Apptainer pulls any OCI/Docker image, converts it to a single read-only .sif
file, and runs it as you, on the host network, with your home directory
mounted.
| Use Apptainer when... | Use Docker/Podman/OrbStack instead when... |
|---|---|
| A GPU tool (COLMAP, OpenMVS, a trainer) must run from a pinned image on a Linux box | The container is a long-running service needing port mapping, compose or networks |
| There is no root, or the distro's podman predates CDI GPU support (< 4.1) | You need isolation from the host — Apptainer shares network, PIDs and $HOME by default |
| The job is "crunch this directory and exit" | The host is macOS — Apptainer is Linux-only; OrbStack/Docker run there |
Images stay OCI, so the same @sha256: image runs under Apptainer on the GPU
box, Docker on a laptop and Kubernetes in CI.
Ubuntu / Pop!_OS, maintained path (apt updates it; needs sudo once):
sudo add-apt-repository -y ppa:apptainer/ppa && sudo apt update && sudo apt install -y apptainer
Use the apptainer-suid package instead only if you need the setuid variant.
On Ubuntu 24.04+, unprivileged user namespaces are restricted by AppArmor and
must be allowed on the host — see the Apptainer admin guide, User Namespace
Requirements.
No root at all: the official install-unprivileged.sh builds a relocatable
install from EPEL RPMs. It needs rpm2cpio, which Debian/Ubuntu lack — see
REFERENCE.md for the stand-in and the full command. Check user
namespaces first: unshare -Ur true && echo ok.
$HOME, Temp Under /tmpA pull downloads the OCI layers into $APPTAINER_CACHEDIR (default
~/.apptainer/cache) and assembles the SIF under $APPTAINER_TMPDIR (default
/tmp). A 3.4 GB CUDA image therefore needs ~3.4 GB of layers plus the
3.2 GB SIF on the root disk unless both are redirected. Point them at the big
disk, persistently, before the first pull:
export APPTAINER_CACHEDIR=/big/disk/apptainer/cache APPTAINER_TMPDIR=/big/disk/apptainer/tmp
mkdir -p "$APPTAINER_CACHEDIR" "$APPTAINER_TMPDIR"
The cache directory must be per-user; do not share one between accounts.
A tag can move; a digest cannot. Resolve the digest once, then pull into a file
named for what it is. Docker Hub's digest already carries the sha256:
prefix, so it follows the @ as-is:
curl -fsSL "https://hub.docker.com/v2/repositories/colmap/colmap/tags?page_size=5&ordering=last_updated" | jq -r '.results[] | "\(.name) \(.digest)"'
apptainer pull /big/disk/images/colmap-20260929.8466.sif docker://colmap/colmap@<digest>
warn rootless{…} ignoring (usually) harmless EPERM on setxattr "security.capability" during an unprivileged pull is expected: file
capabilities cannot be set without root, and batch tools do not use them.
--nv--nv binds the host NVIDIA driver libraries and device nodes into the
container. No nvidia-container-toolkit, no CDI spec. Verify before a long run:
apptainer exec --nv image.sif nvidia-smi -L
The image's CUDA runtime must be supported by the host driver. Read the tool's
own banner too — e.g. colmap help prints with CUDA for a GPU build.
By default Apptainer mounts $HOME, the current directory and /tmp (plus
/proc, /sys, /dev, /etc/hosts and /etc/localtime — the mount * and
bind path lines of apptainer.conf). Data on any other mount is absent inside the
container, and the tool reports a plain "No such file or directory" — it
looks like a wrong path, not a missing bind. Bind data disks explicitly:
apptainer exec --nv --bind /mnt/data image.sif colmap feature_extractor --image_path /mnt/data/images ...
exec runs as your UID with your environment, your network and write access to
everything bound — including $HOME. That is what makes it convenient for batch
tools, and why it is no isolation boundary. For a cleaner run, add --cleanenv
(drop host environment) and --containall (no automatic home/tmp mounts, own
PID/IPC namespaces); then bind exactly what the job needs.
Wrap the call in a shell function, not a string variable:
colmap() { apptainer exec --nv --bind "$DATA" "$SIF" colmap "$@"; }
colmap feature_extractor --database_path "$W/db.db" --image_path "$IMG"
A string such as C="apptainer exec … colmap" followed by $C args fails in
zsh with exit 127, because zsh does not word-split unquoted parameters (see
tools-plugin:zsh-gotchas). This bites over ssh host '…' whenever the remote
login shell is zsh. Run multi-line remote scripts as
ssh host bash -s <<'EOF' … EOF.
For an overnight job, detach it from the SSH session and log to the data disk:
setsid nohup bash run.sh </dev/null >/big/disk/run.log 2>&1 &
| Context | Command |
|---|---|
| GPU visible inside the image | apptainer exec --nv image.sif nvidia-smi -L |
| Image size on disk | ls -lh /big/disk/images/*.sif |
| Tool options in the pinned version | apptainer exec image.sif <tool> <subcommand> -h | grep -E '<flag>' |
| Cache usage | du -sh "$APPTAINER_CACHEDIR" |
| Prune the layer cache | apptainer cache clean -f |
tools-plugin:hf-downloads — the same root-disk trap for Hugging Face cachestools-plugin:zsh-gotchas — why a command string in a variable fails in zshconfigure-plugin:configure-container — building and publishing the OCI images Apptainer consumesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/binary-analysisBinary analysis: strings, binwalk, hexdump, xxd, file, objdump. Use when identifying unknown files, extracting strings, hunting credentials, or entropy analysis./cli-smoke-recipesCLI smoke recipes: expose pure-function modules via subcommands with a bulk-smoke justfile recipe. Use when designing data-transform modules or authoring smoke tests./d2-diagramsGenerate diagrams from text using D2 with automatic layouts and themes. Use when creating architecture diagrams, flowcharts, decision trees, sequence flows, or ERDs./deps-installDeps install: auto-detect package manager (uv, bun, npm, yarn, pnpm, cargo, go) and run the right install. Use when installing deps or syncing lockfiles./fd-file-findingfd fast file finding: smart defaults, gitignore-aware, parallel. Use when searching for files by name, extension, or pattern across directories./generate-imageImage generation via Gemini 3 Pro Image: aspect ratio, resolution, reference images. Use when creating artwork, product photos, or mockups with AI.npx claudepluginhub laurigates/claude-plugins --plugin tools-pluginOther plugins' skills for the same job