tilt-dev / tilt-dev/tilt

docker_build ref injection doesn't inject into :latest when two images

Open
#3,448 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

Reported by Cameron in the tilt channel:

He had a Tiltfile with two docker_builds:

docker_build(image, ...)
docker_build(image + ':init', ...)

He also had Kuberentes YAML that referenced "image:latest" and "image:init".

Tilt complained that the image was not used in any deploy config. This was confusing, because this worked fine with the plain "docker_build(image)"

Workaround

The workaround is to change docker_build(image) to docker_build(image + ":latest")

Possible fixes

There's two different fixes here. We could do one or both.

  1. Make docker_build(image) match image:latest when there are multiple image builds for the same name. This seems like a reasonable expectation (given that :latest is implied in other contexts)
  2. Improve the error message for the case when you the image name matches but the tag name does not match

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the docker_build image/tag matching and ref-injection path, using the two-image example with image:latest and image:init as the reproduction. Done means docker_build(image) correctly matches image:latest alongside another tag, or the error clearly explains the tag mismatch; the issue names no files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.