feat: make docker and kubernetes base template image configurable - #27024
Merged
bpmct merged 1 commit intoJul 6, 2026
Merged
Conversation
jeremyruppel
marked this pull request as ready for review
July 6, 2026 20:09
jeremyruppel
force-pushed
the
feat/template-builder-configurable-image
branch
from
July 6, 2026 20:14
56af5dc to
0797d13
Compare
jeremyruppel
changed the base branch from
main
to
ben/devrel-201-image-guidance-prereqs
July 6, 2026 20:14
bpmct
approved these changes
Jul 6, 2026
…e image configurable Add a container_image variable to the Docker and Kubernetes base templates so admins can override the default container image via the Template Builder UI. The field is a freeform text input with the default value matching the existing default_context.container_image. The templates reference the variable via .Variables.container_image, the same pattern kubernetes already uses for namespace and use_kubeconfig. No special-case logic in the compose pipeline.
jeremyruppel
force-pushed
the
feat/template-builder-configurable-image
branch
from
July 6, 2026 20:18
0797d13 to
8ee2b83
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
container_imagevariable to the Docker and Kubernetes base templates so admins can override the default container image via the Template Builder wizard. The field appears as a freeform text input withcodercom/enterprise-base:ubuntuas the default placeholder.The templates reference the variable via
{{ .Variables.container_image }}, the same pattern kubernetes already uses fornamespaceanduse_kubeconfig. No special-case logic in the compose pipeline; the variable flows throughmergeBaseVariableslike any other base variable.No frontend, API, or SDK changes are needed. The existing
variableToField()inBaseTemplateParametersStep.tsxautomatically renders non-sensitive string variables as text fields, and Docker now shows the base parameters step (previously skipped because it had no variables).Note
This PR was authored by Coder Agents on behalf of @jeremyruppel.
Implementation plan
Approach
Use the variable the same way the kubernetes template already uses
namespaceanduse_kubeconfig: declare it inbase.json, and reference it in the.tf.tmplvia{{ .Variables.container_image }}. The variable flows throughmergeBaseVariableswhich HCL-quotes string values, so the template just emits the value directly (no manual quoting). No special handling incompose.goorrenderBase().Why this works
mergeBaseVariablesconverts string variable defaults and caller-supplied values into HCL-quoted strings (e.g."codercom/enterprise-base:ubuntu"). The kubernetes template already relies on this fornamespace:namespace = {{ .Variables.namespace }}The same pattern works for
container_image:image = {{ .Variables.container_image }}No variable has special meaning. No Go-side override logic.
RFC context: ImageOptions
The RFC describes
ImageOptionsas a curated list that renders into acoder_parameterdropdown for developers at workspace creation time. This task is complementary: it makes the static image configurable by the admin at template creation time. WhenImageOptionsis eventually wired up, the admin's chosen image would become thedefaultof thatcoder_parameterdropdown.