pub fn export_dockerfile(
session: &Session,
params: Option<&[Parameter]>,
) -> StringExpand description
Export a session as a Dockerfile.
Generates a Dockerfile with:
- Metadata header comments (session name, date, command count)
FROM ubuntu:22.04base imageARGdeclarations when parameters are providedWORKDIRinstructions when the working directory changes- One
RUNinstruction per command (no escaping needed) - Annotations for failed commands (non-zero exit codes)
When params is Some, ARG declarations are added after the FROM line
and commands use $VAR references.
Empty sessions produce a valid Dockerfile with a “No commands recorded” comment.