Skip to content

Add runtime field to Docker agent template container settings#1202

Open
Ross-s wants to merge 1 commit intojenkinsci:masterfrom
ExpressThat:feature/runtime-support
Open

Add runtime field to Docker agent template container settings#1202
Ross-s wants to merge 1 commit intojenkinsci:masterfrom
ExpressThat:feature/runtime-support

Conversation

@Ross-s
Copy link
Copy Markdown

@Ross-s Ross-s commented Apr 12, 2026

Adds a runtime field to DockerTemplateBase so users can specify a
container runtime (e.g. sysbox-runc, nvidia) per agent template,
without having to set a default runtime globally in /etc/docker/daemon.json.

Closes #1031

What changed

  • Added runtime field to DockerTemplateBase
  • Wired into HostConfig.withRuntime(runtime) when creating containers
  • Added <f:entry> for Runtime in config.jelly (after Security
    Options), with inline help
  • Added unit tests

Why

The HostConfig API in docker-java already supports .withRuntime(String)
but it was never exposed in the plugin UI. This is a minimal, additive
change with no impact on existing behaviour — the field defaults to null
and is only applied when non-empty.

Use case driving this: running Jenkins agents with
Nestybox Sysbox for secure
Docker-in-Docker without --privileged, which requires --runtime=sysbox-runc.

Testing done

  • Unit test: DockerTemplateBaseTest#testRuntimeField — verifies field
    is stored and retrieved correctly
  • Manual: provisioned a sysbox-runc agent via Jenkins Docker Build Cloud;
    docker info inside the agent confirms DinD is functional

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Introduces the ability to specify a custom OCI runtime for Docker containers via the `runtime` property in DockerTemplateBase.
@Ross-s Ross-s requested a review from a team as a code owner April 12, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add runtime docker agent template container option

1 participant