Skip to main content

Container Interaction in a Live Terminal Session

Any just-in-time container object can be interacted with or inspected by starting an ephemeral interactive session, directly from the CLI. This feature is very useful for debugging and experimenting since it allows you to inspect containers directly and at any stage of your Dagger Function execution.

To start an interactive session for a container returned by a Dagger Function, use dagger call ... terminal. By default, the terminal is started with the sh shell, although this can be overridden by adding the --cmd argument.

Here is an example of starting an interactive terminal with the Wolfi base container returned by the Container() function of the wolfi module:

dagger call -m github.com/shykes/daggerverse/wolfi@v0.1.4 container --packages=cowsay terminal

To start the same terminal with the zsh shell, use:

dagger call -m github.com/shykes/daggerverse/wolfi@v0.1.4 container --packages=cowsay,zsh terminal --cmd=zsh