Skip to content

docker:push failed with ARG in FROM #1778

Closed

Description

@ChristianKnof

Description

As seen in the example [dockerfile-base-as-arg|https://github.com/fabric8io/docker-maven-plugin/blob/master/it/dockerfile-base-as-arg/src/main/docker/Dockerfile] we tried to parametrize our docker-builds, the docker:build works fine, but the following docker:push crashes with:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.44.0:push (default-cli) on project xxx: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.44.0:push failed: Given Docker name '${baseImage}' is invalid:
[ERROR] * image part '${baseImage}' doesn't match allowed pattern '[a-z0-9]+(?:(?:(?:[.]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[.]|__|[-]*)[a-z0-9]+)+)?)+)?'

Info

OUR: Property:
<docker.buildArg.baseImage>privateImageRegistry/privateImage:CustomTag</docker.buildArg.baseImage>

OUR-Configuration:
<plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <configuration> <images> <image> <name>${docker-registry.url}/${project.artifactId}:${project.version}</name> <build> <contextDir>${project.basedir}</contextDir> <dockerFile>${project.basedir}/docker/Dockerfile</dockerFile> <noCache>true</noCache> </build> </image> </images> </configuration> </plugin>
OUR simplified Dockerfile:
ARG baseImage FROM ${baseImage}

  • docker-maven-plugin version : 0.44.0
  • Maven version (mvn -v) : 3.9.4

Activity

  1. rohanKanojia commented on Apr 12, 2024

    @rohanKanojia
    Member

    Do you think this is duplicate of #1756 ? Could you please check via SNAPSHOT build if it's working as expected?

  2. ChristianKnof commented on Apr 12, 2024

    @ChristianKnof
    Author

    Thank you for the quick reply. I have tried 0.45-SNAPSHOT, but it is the same error message. It seems to be the same environment as #1756, however the docker:build is successful, only the docker:push fails. As an addition, the ARG is set with a property "docker.buildArg.baseImage". The ARG section in the BUILD has been removed.
    I have added our configuration and the simplified Dockerfile in the tickettext.

  3. rohanKanojia commented on Apr 13, 2024

    @rohanKanojia
    Member

    @ChristianKnof : Thanks for reporting! I can reproduce the issue.

  4. nodece commented on Apr 29, 2024

    @nodece
    Contributor

    Any updates?

  5. rohanKanojia commented on Apr 29, 2024

    @rohanKanojia
    Member

    @nodece : Let me provide a fix this week.

  6. self-assigned this
    on Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions