Open codeRuslan opened 1 year ago
If the file inside of buildkit and the secret file you input in are the same, then this isn't a buildkit issue.
Obviously, you can't share the contents of your RSA key file, but what does the format look like (removing any sensitive information)?
Just a note (but unrelated to the error you're having): you shouldn't copy the secret file between multiple layers - this will store the secret in the resulting image, which defeats the purpose of secrets. You should instead only mount the secret in the RUN
command in which you're trying to use it.
I got the following error:
While building this test Dockerfile:
The command that I execute for it:
However, I have also tried just to use env varible for docker secret with the following build command:
And with this changed Dockerfile layer:
With debug layer -
RUN cat /root/.ssh/id_rsa
I see that id_rsa looks totally fine inside container, as it should look like ssh key, however the error of invalid format still persists