Skip to content
Docs

Host Commands

Host commands let you include native host binaries in a crate alongside containerized commands. Unlike regular commands (which run inside containers), host_commands are resolved from the host system at activation time.

Some tools don’t belong in containers:

  • Shell utilities needed by scripts or the user (id, which, ls)
  • Scripting languages that orchestrate containers (python3, perl)
  • Version control and build tools (git, make)

In normal (non-strict) mode, these are already on your PATH, so host commands don’t create any shimlink directory entries. In strict mode, the PATH is replaced entirely — host commands create symlinks in the shimlink directory that point directly to the resolved host binary path.

List host binary names under host_commands:

manifest:
name: my-pipeline
host_commands:
- python3
- perl
- git
commands:
- command: samtools
docker_image: quay.io/biocontainers/samtools:1.9--h91753b0_8

Each name is resolved to an absolute path via which at activation time. In strict mode, a symlink is created in the shimlink directory pointing directly to the resolved host binary. In non-strict mode, no shimlink entry is created — the command is found naturally on the preserved PATH.

Regular commandsHost commands
Runs inContainerHost
Shimlink entrySymlink to bulker binary (busybox dispatch)Symlink to resolved host binary (strict mode only) / No entry (non-strict)
Needs Docker imageYesNo
Needed in normal modeYesOptional (already on PATH)
Needed in strict modeYesYes (only way to access host binaries)

Host commands work correctly with Python virtual environments and other environment managers. In strict mode, the symlinks point directly to the resolved host binary, so argv[0] resolves to the real binary path. CPython’s venv detection sees the correct path and activates the virtual environment properly. This works regardless of the order in which the venv and bulker crate are activated.

Rather than listing host commands in every manifest, import a base crate that provides them:

manifest:
name: my-pipeline
imports:
- bulker/alpine
commands:
- command: samtools
docker_image: quay.io/biocontainers/samtools:1.9--h91753b0_8

See Import Crates for the complete list of available base crates.

Use host commands when the tool:

  • Is a system utility needed by other tools or the user (e.g., id, which, ls)
  • Orchestrates other commands and needs to see the shimlink directory
  • Is a scripting language or build tool that shouldn’t run in a container

Use regular (containerized) commands when the tool:

  • Has specific version requirements
  • Should be reproducible across machines
  • Has complex dependencies you don’t want to install on the host