Skip to content

fix: append '-base' to dev-mode image names to avoid overwriting cog build images#2802

Open
bfirsh wants to merge 1 commit intomainfrom
fix/base-image-name-suffix
Open

fix: append '-base' to dev-mode image names to avoid overwriting cog build images#2802
bfirsh wants to merge 1 commit intomainfrom
fix/base-image-name-suffix

Conversation

@bfirsh
Copy link
Member

@bfirsh bfirsh commented Mar 3, 2026

Summary

  • Dev-mode commands (cog serve, cog predict, cog run, cog train) now tag their ephemeral images with a -base suffix (e.g. cog-myproject-base) so they don't overwrite images built by cog build.
  • Renames the SkipLabels build option to BaseImageOnly, which better describes the intent of the flag.

Context

This was a regression introduced in 1525f7f (PR #2746) which removed the BuildBase() code path and BaseDockerImageName() helper as part of consolidating dev-mode builds to use Build(ExcludeSource=true). The -base suffix was originally introduced in 3b09bab (Jul 2021).

Changes

  • pkg/config/image_name.go — Restore BaseDockerImageName() which appends -base
  • pkg/model/options.go — Rename SkipLabelsBaseImageOnly; use BaseDockerImageName when BaseImageOnly is true
  • pkg/model/factory.go — Update call site for rename
  • pkg/image/build.go — Rename parameter skipLabelsbaseImageOnly
  • pkg/cli/serve.go — Update serveBuildOptions() for rename
  • pkg/config/image_name_test.go — Add tests for BaseDockerImageName
  • pkg/model/options_test.go — Add tests for dev-mode default image naming

…build images

Dev-mode commands (cog serve, predict, run, train) now tag their
ephemeral images with a '-base' suffix (e.g. 'cog-myproject-base')
so they don't overwrite images built by 'cog build'.

This was a regression introduced in 1525f7f (PR #2746) which removed
the BuildBase() code path and BaseDockerImageName() helper as part of
consolidating dev-mode builds to use Build(ExcludeSource=true).

Also renames the SkipLabels field to BaseImageOnly, which better
describes the intent of the flag.
@bfirsh bfirsh requested a review from a team as a code owner March 3, 2026 22:33
@michaeldwan michaeldwan added this to the 0.18.0 milestone Mar 5, 2026
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.

2 participants