You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix ARG referencing another ARG in FROM statement #1800
ARG IMAGE_NAME=alpine
ARG IMAGE_TAG=latest
ARG FULL_IMAGE=${IMAGE_NAME}:${IMAGE_TAG}
FROM ${FULL_IMAGE}
results in the error below:
Caused by: java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendExpandedReplacement (Matcher.java:1113)
at java.util.regex.Matcher.appendReplacement (Matcher.java:1043)
at java.util.regex.Matcher.replaceFirst (Matcher.java:1446)
at java.lang.String.replaceFirst (String.java:3025)
at io.fabric8.maven.docker.util.DockerFileUtil.resolveImageTagFromArgs (DockerFileUtil.java:189)
at io.fabric8.maven.docker.util.DockerFileUtil.extractBaseImages (DockerFileUtil.java:70)
This is because DockerFileUtil.resolveImageTagFromArgs doesn't recursively resolve the args, and the curly brackets of the inner arg breaks the Pattern replacement.
Activity
fix: arg stated in a FROM clause can reference other args (fabric8io#…
fix: arg stated in a FROM clause can reference other args (fabric8io#…
fix: arg stated in a FROM clause can reference other args (fabric8io#…
fix: arg stated in a FROM clause can reference other args (fabric8io#…
fix: arg stated in a FROM clause can reference other args (fabric8io#…
fix: arg stated in a FROM clause can reference other args (#1800)
rohanKanojia commentedon Jul 28, 2024
@kevinleturc : I have released 0.45.0 . Could you please check if everything is working as expected in your project and provide feedback?
kevinleturc commentedon Jul 30, 2024
I have checked the fix in our project and everything is working as expected.
fix: arg stated in a FROM clause can reference other args (fabric8io#…