Shell Debugging
For debugging, it can be useful to enter a shell within a container. Since bulker provides shimlinks that dispatch to containers via argv[0], it’s not immediately obvious how to get into a container interactively.
Use underscore commands for interactive shells
Section titled “Use underscore commands for interactive shells”For every command in a crate, bulker also creates an underscore variant: _COMMAND. For example, the demo crate with cowsay and fortune also provides _cowsay and _fortune.
Running an underscore command drops you into a shell inside the container that would be used to run that command, without actually running the command. This lets you debug the container interactively in the exact same environment bulker uses.
bulker activate demo_cowsay # opens a shell in the cowsay containerPrint the container command
Section titled “Print the container command”To see the exact docker run or apptainer exec command that a shimlink would execute:
# Using the -p flagbulker exec -p demo -- samtools --version
# Or set the environment variableexport BULKER_PRINT_COMMAND=1samtools --version # prints the command instead of running itThis is useful for debugging volume mounts, user mapping, and other container settings.