kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Kaniko doesn't change the value of upstream image variable value by build-arg

Open cniry opened this issue 1 year ago • 0 comments

Actual behavior Kaniko doesn't change the value of upstream image variable value by build-arg.

To Reproduce Steps to reproduce the behavior: Simplified example Dockerfile:

FROM alpine AS upstream-image
ENV HELLO=UPSTREAM

FROM upstream-image as my-build
ARG HELLO
RUN echo "Hello $HELLO"

Execute Kaniko build with build-argument:

/kaniko/executor --build-arg HELLO=WORLD  --context . --no-push

or Execute in Docker:

docker build --progress=plain  --build-arg  HELLO=WORLD .

Behavior This docker file prints Hello WORLD in Docker, but prints Hello UPSTREAM in Kaniko.

Expected behavior Upstream ENV value should be overridden by ARG.

Version Tested on the latest version

cniry avatar Oct 15 '24 23:10 cniry