-
Notifications
You must be signed in to change notification settings - Fork 645
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
ARG still not working properly in FROM #1372
Comments
Ping @rohanKanojia and @rhuss who extensively worked on the related issue. |
@ThatDockerUser : Where is value of |
@rohanKanojia From the POM, via the |
I wasn't aware of this |
Thanks for taking this on, I will also note here that the variable format with the braces does not work irrespective of the POM usage, such as in this:
|
…nfiguration Refactored `DockerFileUtil.extractBaseImages` to accept a HashMap of Build args which would be passed from BuildService in order to resolve ARG values which are provided from plugin configuration
I'm checking this case when you build with a Dockerfile like this:
Even when I build this with plain docker, it doesn't seem to be resolved. I think it's more of a docker behavior rather than plugin's, maybe arg was no longer in build scope after passing from:
|
…nfiguration Refactored `DockerFileUtil.extractBaseImages` to accept a HashMap of Build args which would be passed from BuildService in order to resolve ARG values which are provided from plugin configuration
Maybe that is also a bug within Docker, but any ARG configured prior to the FROM remains valid in the FROM. The PR addresses this, so I hope it can be merged and released soon. |
…on (#1373) Refactored `DockerFileUtil.extractBaseImages` to accept a HashMap of Build args which would be passed from BuildService in order to resolve ARG values which are provided from plugin configuration Co-authored-by: Roland Huß <roland@ro14nd.de>
Description
This was already discussed extensively since 2017 at #859 and partially fixed by #1299 with a new release today. I tested it, and there are several cases where it still does not work.
MWE pom.xml:
I want to use busyboxVersion, as supplied by Maven, in my Dockerfile, so I do this:
But upon building, I get this:
Apparently, the ARG is not resolved, although this is the correct format as per the documentation. So, I change it to this:
And get this:
The ARG is now resolved, but has no content. Hence, I test this:
The image is now built (since the version is again hard-coded), but upon inspecting it in Docker, I get this:
Once again, the ARG was resolved to an empty string, while the second ARG was interpreted correctly. I further this test like so:
Now inspecting the Docker image, everything is alright:
Info
mvn -v
) :The text was updated successfully, but these errors were encountered: