Update a nested container image value in place.
Section: Edit and transform YAML with yq
Set an image tag
bash
bash
yq -i '.spec.template.spec.containers[0].image = "repo/api:v2"' deployment.yamlExplanation
Useful for release pipelines that stamp manifests with a new image tag.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Edit and transform YAML with yq