Skip to content

feat: support long syntax for image names and build tags#13709

Open
ssam18 wants to merge 1 commit intodocker:mainfrom
ssam18:feat/image-long-syntax
Open

feat: support long syntax for image names and build tags#13709
ssam18 wants to merge 1 commit intodocker:mainfrom
ssam18:feat/image-long-syntax

Conversation

@ssam18
Copy link
Copy Markdown
Contributor

@ssam18 ssam18 commented Apr 3, 2026

Users can now write image as a map with name, tag, and digest fields instead of a plain string. The same long syntax works for entries in build.tags, so a single YAML anchor can drive both the service image and the build tags without string interpolation tricks.

The core parsing changes live in compose-spec/compose-go (see ssam18/compose-go feat/image-long-syntax); this PR wires in that dependency and adds loader-level tests. Once the upstream compose-go PR is merged and released, the replace directive here will be swapped for a normal version bump.

Example usage:

x-version: &version 1.0.0

services:
  my:
    image:
      name: myimage
      tag: *version
    build:
      context: .
      args:
        VERSION: *version
      tags:
        - name: myimage
          tag: *version
        - name: myimage
          tag: latest

@ssam18 ssam18 requested a review from a team as a code owner April 3, 2026 15:05
@ssam18 ssam18 requested review from glours and ndeloof April 3, 2026 15:05
This adds support for specifying image references using a map with
name/tag/digest fields instead of a plain string, making it possible
to use YAML anchors for version management in compose files.

Depends on compose-spec/compose-go#NNN (ssam18/compose-go feat/image-long-syntax)

Signed-off-by: Samaresh Kumar Singh <[email protected]>
@ssam18 ssam18 force-pushed the feat/image-long-syntax branch from e776ed4 to 61132b6 Compare April 3, 2026 15:06
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.

1 participant