Skip to content

feat(chart): make DinD sidecar image configurable via values#4417

Open
frank-bee wants to merge 2 commits intoactions:masterfrom
frank-bee:feat/configurable-dind-image
Open

feat(chart): make DinD sidecar image configurable via values#4417
frank-bee wants to merge 2 commits intoactions:masterfrom
frank-bee:feat/configurable-dind-image

Conversation

@frank-bee
Copy link

Summary

  • Add containerMode.dindImage value to gha-runner-scale-set chart to allow overriding the hardcoded docker:dind image in the DinD sidecar
  • Defaults to docker:dind — fully backward compatible, no behavior change for existing users

Motivation

containerMode.type: dind currently hardcodes docker:dind with no way to override it. Users who need a custom DinD image (e.g., with pre-configured daemon.json for registry mirrors or insecure registries) are forced to abandon containerMode entirely and manually reimplement the full DinD pod spec.

The experimental chart already supports this via runner.dind.container.image. This PR backports the same capability to the stable chart with a minimal, non-breaking change.

Changes

  • _helpers.tpl: Change image: docker:dind to image: {{ .Values.containerMode.dindImage | default "docker:dind" }}
  • values.yaml: Add commented-out dindImage option under containerMode with documentation

Test plan

  • helm template with containerMode.type=dind and no dindImage → renders image: docker:dind (backward compat)
  • helm template with containerMode.type=dind and dindImage: custom/dind:v1 → renders image: custom/dind:v1
  • Existing unit tests pass

Closes #4416

Related: #3709, #3120, #2765, #3439, #3547

Add containerMode.dindImage to allow overriding the hardcoded
docker:dind image in the DinD sidecar container.

This enables users to provide a custom DinD image with pre-configured
daemon.json (e.g., registry mirrors for pull-through caches, insecure
registries) without having to abandon containerMode entirely and
manually define the full pod spec.

Closes actions#3709
Copilot AI review requested due to automatic review settings March 21, 2026 15:13
@frank-bee frank-bee requested review from a team as code owners March 21, 2026 15:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the Docker-in-Docker (DinD) sidecar image configurable in the stable gha-runner-scale-set Helm chart by introducing a containerMode.dindImage value, defaulting to docker:dind for backward compatibility.

Changes:

  • Add documentation in values.yaml for a new optional containerMode.dindImage setting.
  • Update the DinD container helper to render image: from Values.containerMode.dindImage (falling back to docker:dind).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
charts/gha-runner-scale-set/values.yaml Documents the new containerMode.dindImage option for overriding the DinD sidecar image.
charts/gha-runner-scale-set/templates/_helpers.tpl Switches the DinD sidecar image from hardcoded docker:dind to a configurable value with a default fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# ## Optional: override the default docker:dind image used for the DinD sidecar container.
# ## This is useful for using a custom image with pre-configured daemon.json
# ## (e.g., registry mirrors, insecure registries) or other customizations.
# # dindImage: "docker:dind"
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example line for dindImage is double-commented (# # dindImage: ...). If a user uncomments the containerMode block by removing the leading #, this line will still remain commented and the option can be missed. Use a single leading # like the other fields in this example block.

Suggested change
# # dindImage: "docker:dind"
# dindImage: "docker:dind"

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — removed the extra comment level so dindImage is now single-commented like the other fields in the block.

Comment on lines +118 to +122
## empty, and configuration should be applied to the template.
# containerMode:
# type: "dind" ## type can be set to "dind", "kubernetes", or "kubernetes-novolume"
# ## Optional: override the default docker:dind image used for the DinD sidecar container.
# ## This is useful for using a custom image with pre-configured daemon.json
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The surrounding documentation says that if any customization is required for dind/kubernetes mode, containerMode should remain empty and users should customize via template. Adding containerMode.dindImage introduces an official customization knob under containerMode, which contradicts that guidance—please update the wording to clarify that dindImage is supported while deeper customization still requires using template.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — updated the wording to clarify that dindImage is a supported customization knob, while deeper customization (extra env vars, volume mounts, security contexts) still requires dropping containerMode and using template directly.


{{- define "gha-runner-scale-set.dind-container" -}}
image: docker:dind
image: {{ .Values.containerMode.dindImage | default "docker:dind" }}
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds new behavior (allowing users to override the DinD image). The chart has unit tests asserting the default docker:dind, but there’s no test covering the new override path. Add a unit test that sets containerMode.dindImage and asserts the rendered dind container image matches it.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TestTemplateRenderedAutoScalingRunnerSet_EnableDinD_CustomImage — sets containerMode.dindImage to a custom image and asserts the rendered DinD container uses it.

- Fix double-commenting on dindImage example in values.yaml
- Update containerMode docs to clarify that dindImage is a supported
  customization while deeper changes still require using template
- Add unit test for custom dindImage rendering
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.

feat: make DinD sidecar image configurable in gha-runner-scale-set chart

2 participants