You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create and GPG-sign a built binary with Dagger.
To do this, I need to mount my ~/.gnupg directory into my container and run gpg --detach-sign --armor binary-name.
The above command requires the following files (keyrings and trustdb) to create the signature:
~/.gnupg/pubring.kbx
~/.gnupg/trustdb.gpg
~/.gnupg/private-keys-v1.d/*
Currently Dagger only permits mounting files as secrets. It's not possible to mount an entire directory hierarchy as a secret; each file has to be mounted manually.
Can Dagger allow directories to be mounted as secrets, as it does with files?
Why is this important to you?
It will make it simpler to sign binary builds with GPG.
It is not possible on buildkit for now but other use case than GPG exist.
The best would be to fix upstream, but it might be faster to do it on our side first if we want it soon.
Yes, that is the initial idea. My fear is that creating the folder structure on the container might leave trace in the cache/image. (the file would be considered secrets, ok, but the folder would have to be created in the container first and wouldn't be considered secrets, so they would linger).
Also, I don't have any idea how to pass the rights as well.
I think it's more complex than it looks.
Added the documentation label because while there's a native way to mount secret files, mounting secret directories is just an abstraction on top of that. The #5520 cookbook demonstrates an example.
Activity
dolanor commentedon Apr 6, 2023
It is not possible on buildkit for now but other use case than GPG exist.
The best would be to fix upstream, but it might be faster to do it on our side first if we want it soon.
TomChv commentedon Apr 6, 2023
@dolanor Can't we just walk through the given directories and transform these files into secrets?
dolanor commentedon Apr 7, 2023
Yes, that is the initial idea. My fear is that creating the folder structure on the container might leave trace in the cache/image. (the file would be considered secrets, ok, but the folder would have to be created in the container first and wouldn't be considered secrets, so they would linger).
Also, I don't have any idea how to pass the rights as well.
I think it's more complex than it looks.
grouville commentedon Apr 17, 2023
Currently stuck by #4739. Could be actionable when related PR gets merged #4932
grouville commentedon May 2, 2023
Stuck by #5069, which would need to be implemented first, if we agree on having a client-side implementation.
Client-side implementation of above example, using
with()Go SDK
Node SDK
grouville commentedon Jul 28, 2023
Reopening, following the revert
helderco commentedon Aug 1, 2023
Added the documentation label because while there's a native way to mount secret files, mounting secret directories is just an abstraction on top of that. The #5520 cookbook demonstrates an example.