-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Missing or partial support for pattern substition in variable references (e.g. in RUN) #1246
Comments
Still an issue in v1.2.0. For example, the parameter expansion |
I cannot build the airflow image using kaniko, it works fine with the docker build. Error
Code
|
Same on v1.3.0 with cache |
Still seeing this on the latest version (1.3.0) - removing the |
Same problem in latest version using cache: Shell form:
Exec form:
|
Checking |
I also ran int this issue with: RUN something --version="release-${APP_VERSION%.*}" A workaround with ARG APP_VERSION_MAJMIN=${APP_VERSION%.*} just gave me: It would be nyce to fix it. |
I am seeing the same issue. I am having to move out all complex shell parameter expansions out of the docker file and plug them in through build args. These expansions should be handled by the shell in a shell version of the |
A more local (but still pretty lame...) workaround may be to reformulate the expansions using command substitution and a pipeline (as in |
Still an error in 1.6.0 with cache |
Please fix this bug. Its annoying as hell and makes it unusable |
This issue is still present when building with cache on |
Still happen on 1.7.0 kaniko version with cache. |
Is there a workaround for this? Like, not using cache? |
@tushar-door you can work around by moving the problematic lines to a shell script |
Another workaround: |
That’s the best workaround for me. (Edit: fixed quotes) |
FYI you are missing closing |
I found the easiest and most obvious workaround is to do the substitution with an -RUN curl --location --output /envsubst "https://github.com/a8m/envsubst/releases/download/v${ENVSUBST_VERSION}/envsubst-${TARGETOS}-${TARGETARCH/amd64/x86_64}" && \
+RUN if [ "$TARGETARCH" = "amd64" ]; then TARGETARCH=x86_64; fi && \
+ curl --location --output /envsubst "https://github.com/a8m/envsubst/releases/download/v${ENVSUBST_VERSION}/envsubst-${TARGETOS}-${TARGETARCH}" && \ |
Hi all! |
i used the same type of workaround.... ex: "$(echo "${f}" | sed "s/.example$//")" in place of 'echo ${f%.example}' |
I'm experiencing a very similar issue (the error message is slightly different). The following line in my Dockerfile
causes Kaniko to output
If I disable the cache, the error no longer shows up – which, of course, is not a workaround but makes me believe the issue I'm seeing is related to the present discussion. |
I have an idea. I'll try to fix it by the end of the week |
Good job @kt315 Thanks. |
I can also confirm using Kaniko version 1.22 helped me out against this bug. Thank you @kt315 |
Here is a minimal working example that reproduces this issue with across different Kaniko versions, with and without caching. (The script assumes
bash
and a terminal capable of highlighting).The output is omitted for brevity (just run the script). The results are mixed. The following table provides a summary.
Essentially, v0.19.0 is broken irrespective of caching, while earlier versions appear to be fine, and later versions only break when caching is turned on.
The last and likely most relevant part of the compounded error comes from this line
The text was updated successfully, but these errors were encountered: