Is not using --no-cache safe when building Docker image using BuildKit to pass secret

685 Views Asked by At

Is there any difference in terms of security of the secret between these 2 commands while building Docker image with Docker Buildkit (export DOCKER_BUILDKIT=1).

docker build --no-cache --progress=plain --secret id=mysecret,src=mysecret.txt .

With or without using cache

docker build --progress=plain --secret id=mysecret,src=mysecret.txt .

Command took from: https://docs.docker.com/develop/develop-images/build_enhancements/

0

There are 0 best solutions below