Skip to content

targets: dockerfile changes in line zero #9690

Description

@ibisd1

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Dear sir or madam,

i got a dockerfile in which i want to update the Image Tag in the FROM Line.

I am using:

name: external-deps

sources:
  quayio-keycloak:
    kind: dockerimage
    spec:
      image: "quay.io/keycloak/keycloak"
      versionFilter:
        kind: semver

targets:
  set-keycloak-version-in-dockerfile:
      kind: dockerfile
      sourceid: quayio-keycloak
      spec:
        file: "_Keycloak/Dockerfile"
        instruction:
          keyword: FROM
          matcher: quay.io/keycloak/keycloak
FROM quay.io/keycloak/keycloak:26.4.0 AS final
WORKDIR /opt/keycloak

COPY ["providers", "providers"]
COPY ["themes", "themes"]

ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

and I am getting an error
ERROR: something went wrong in "target#set-keycloak-version-in-dockerfile" : ✗ No line found matching the keyword "FROM" and the matcher "quay.io/keycloak/keycloak"

If i add a first line it is working...

# syntax=docker/dockerfile:1
FROM quay.io/keycloak/keycloak:26.4.0 AS final
WORKDIR /opt/keycloak

COPY ["providers", "providers"]
COPY ["themes", "themes"]

ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

Expected Behavior

It should run the change to the current major version in both cases.

Steps To Reproduce

  1. Create a Dockerfile
FROM quay.io/keycloak/keycloak:26.4.0 AS final
WORKDIR /opt/keycloak

COPY ["providers", "providers"]
COPY ["themes", "themes"]

ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
  1. Create an manifest.yaml
name: external-deps

sources:
  quayio-keycloak:
    kind: dockerimage
    spec:
      image: "quay.io/keycloak/keycloak"
      versionFilter:
        kind: semver

targets:
  set-keycloak-version-in-dockerfile:
      kind: dockerfile
      sourceid: quayio-keycloak
      spec:
        file: "_Keycloak/Dockerfile"
        instruction:
          keyword: FROM
          matcher: quay.io/keycloak/keycloak
  1. run "updatecli --debug pipeline apply --config manifest.yaml"

Environment

- OS:
Linux XXXXXX 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ("WSL" "Ubuntu Jammy")
- updatecli:
VERSION

Application:    0.119.0
Golang     :    1.26.5 linux/amd64
Build Time :    2026-07-09T15:27:02Z

Pipeline Graph

OpenTelemetry Trace

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions