Use the --secret flag from BuildKit to pass-on build secrets as stored in the dummy-secrets.json file: docker build --no-cache -t myimage \ --secret id=secretsfile,src=./dummy-secrets.json\ --progress=plain . References: Build secrets in Docker and Compose, the secure way Docker build secrets: the easy way, the wrong way, the sneaky way Build images with BuildKit