kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Cannot pass empty value of --build-arg

Open LinuxSuRen opened this issue 1 year ago • 0 comments

Actual behavior I tried to give ARG an empty value, but it's failed. The ARG still uses the default value. See below Dockerfile

ARG REGISTRY=172.11.0.6:30002/
FROM ${REGISTRY}docker.io/library/golang:1.20 as builder

when I run the following command,

docker run -v .:/data gcr.io/kaniko-project/executor:latest \ --no-push --dockerfile=/data/Dockerfile --build-arg REGISTRY=''

it still pulls image from 172.11.0.6:30002/docker.io/library/golang:1.20

Expected behavior It can pull image from docker.io/library/golang:1.20

To Reproduce See above.

Additional Information

  • Dockerfile Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
  • Build Context Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
  • Kaniko Image (fully qualified with digest)

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [x]

LinuxSuRen avatar May 09 '24 06:05 LinuxSuRen