jenkinsci / jenkinsci/docker-plugin

Add runtime docker agent template container option

Open
#1,031 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
498
Forks
324
Avg merge
1d 2h
Merged PRs (30d)
2

Description

### What feature do you want to see added?

Container settings for Docker agent template on Jenkins cloud do not provide an option to specify which runtime should be used for the cloud container. Command line equivalent for this is using `--runtime` parameter when running docker container.

This seems to be one of the few options missing from the configuration. It is supported by docker-java project (`HostConfig.withRuntime(String)`), but not set in `DockerTemplateBase`.

Option to use docker command as launch method, per #468, gives a workaround which is not applicable for docker cloud within Jenkins, and requires non-trivial approach to run commands on agents.

Another workaround, which I'm currently using, is to set default runtime on a cloud machine level using configuration in `/etc/docker/daemon.json`.

```json
{
"default-runtime": "sysbox-runc",
}
```

Such approach has own disadvantages by using non-default runtime for all containers, even ones which prefer other runtimes. Example for this are containers / docker agent templates which use nvidia runtime.

**Proposed solution**
Add option for runtime selection on Container settings within docker cloud agent templates.

### Upstream changes

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.