Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker:push failed with ARG in FROM #1778

Open
ChristianKnof opened this issue Apr 12, 2024 · 5 comments
Open

docker:push failed with ARG in FROM #1778

ChristianKnof opened this issue Apr 12, 2024 · 5 comments
Assignees

Comments

@ChristianKnof
Copy link

ChristianKnof commented Apr 12, 2024

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
@rohanKanojia
Copy link
Member

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

@ChristianKnof
Copy link
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.

@rohanKanojia
Copy link
Member

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

@nodece
Copy link

nodece commented Apr 29, 2024

Any updates?

@rohanKanojia
Copy link
Member

@nodece : Let me provide a fix this week.

@rohanKanojia rohanKanojia self-assigned this Apr 29, 2024
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

No branches or pull requests

3 participants