-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"gpg: can't connect to the agent: IPC connect call failed" error in docker alpine on shared volume #806
Comments
I haven't dug in yet but when you mention this:
it sounds like it might be a file/directory permissions/ownership issue; perhaps which is keeping Can you try running the whole example with the env |
Just added more info on the host system (sry for omitting before):
Mentioning this, because in this setup the permissions are not transferred from the host system (instead, they are
Unfortunately no additional info:
But: It revealed that the same error is happening on
(that was "hidden" before). FYI: Everything "still works", i.e. I am still able to decrypt the files with #594 mentions
so I'm also attaching the output of that command (sry for the wall of text - there more info at the bottom of this post)
Executing the last command with
Running the same thing in
|
Short follow up: I checked the running
Killing and restarting it works:
Trying the same in the
|
I believe I understand the issue now - though I'm not sure if/how this can be solved by Here's my understanding of the issue:
There is unfortunately no easy way to configure the location of the socket (in fact, it's 4 sockets), but one has to create three files in the Note, that i created the empty directory S.gpg-agent
S.gpg-agent.ssh
gpg-agent.conf
See also https://askubuntu.com/a/1053594/1583296 Afterwards, all commands work as expected without errors:
The big problem that I see here, is that the location of the sockets would have to be "hard-coded" in the repository (i.e. in the This is okay for "my" use case, because the whole point of setting Maybe something like Soo.. any thoughts? |
I'm not exactly clear what your use case is; I can't quite figure out what problem you're trying to solve. |
I try to reduce the amount of tools that each individual dev in a team needs to set up locally as much as possible. We use I'll release a longer article on the exact setup with a proof of concept next weeks. The corresponding code is already live at https://github.com/paslandau/docker-php-tutorial/tree/part-6-git-secret-encrypt-repository-docker (though the build might currently fail due to codecasts/php-alpine#160 ) From the article:
# checkout the branch
git checkout part-6-git-secret-encrypt-repository-docker
# build and start the docker setup
make make-init
make docker-build
make docker-up
# "create" the secret key - the file "secret.gpg.example" would usually NOT live in the repo!
cp secret.gpg.example secret.gpg
# intialize gpg
make gpg-init
# decrypt the secret file
make secret-decrypt
# show the content of the secret file
cat passwords.txt In the following gif, all commands are run "through docker" (abstracted via |
Please explain your use case much more simply. This feels like an XY problem: https://xyproblem.info/ Your example is so removed from the normal case of 'add a user's public key to a git-secret repo's keychain and let them decrypt/encrypt secrets until their key changes or they should no longer have access' that I can't understand how you intend to use git-secret in real life. For example, in your examples above, there is one keypair that can encrypt/decrypt secrets, so it doesn't make sense to me to use 'removeperson' at the end of your example (although it is a great example of how to generate an error, which is valid, and I think we have largely addressed as a permissions issue) In your target case (not a idealized example), who controls private keys, how many keypairs are you planning on using (generally), where are they stored (generally), who is allowed to decrypt secrets. (Previous paragraph edited for clarity). Edit: lastly, I love the animated gifs showing your tests, but since I can't easily pause or slow down the animations it's difficult to follow along (also would be best if your examples just used basic commands and git-secret ones instead of a level of abstraction on top of them, but, no big deal). |
Hey @joshrabinowitz, sorry for the late reply and the confusion. Here's where I was coming from (probably helpful for context): I was writing a blog post about using In this setup I believe it's quite common to share the codebase on the host system with the docker container that runs the application, so that any changes are reflected immediately. Running the application on docker instead of "locally on the host system" has the big benefit that everybody uses the same infrastructure - no more problems with different PHP versions, missing extensions etc. Following this logic, I went one step further and also added the tooling for the development process itself directly in the docker container. Tooling being e.g. I've also described that in more detail at https://www.pascallandau.com/blog/git-secret-encrypt-repository-docker/#local-git-secret-and-gpg-setup => Does this make more sense?
I have also added the common workflow scenarios (onboarding a new developer, adding/deleting files, offboarding a dev) under https://www.pascallandau.com/blog/git-secret-encrypt-repository-docker/#scenarios
Yeah sorry for that... The second gif was actually part of the tutorial and not meant to be used "standalone". Just had it available and thus added it here. Is it still useful? I hope https://www.pascallandau.com/blog/git-secret-encrypt-repository-docker/ should clarify any questions - though I do realize it's quite a lot to ask reading a whole article... so let me know if I can clarify anything else directly. Cheers |
Hello, @paslandau Thanks for following up. You present an unusual use case, but it's an important one perhaps, and you do present a reasonable solution to the problem. If you submit a PR, we will consider it for inclusion. |
I try to build an alpine docker image that contains
git-secret
and can be used to encry/decrypt files in a codebase that is shared with the host system. My Host system is Windows 10 and I use Docker Desktop (non-WSL).When running
git secret killperson
in the container within the shared folder, the erroris shown. It does not appear when
git secret
is used in a non-shared folder.What were you expecting to happen?
No error is shown
What are the steps to reproduce this issue?
alpine:3.15.2
as base imagegit, gnupg and git-secret
[email protected]
(FYI: I'm using a MinGW shell on Windows and need to run the following command:
shared
folder[email protected]
[email protected]
Any logs, error output, etc?
Any other comments?
When running the same commands on a non-shared folder (e.g.
/tmp
), everything works as expected. Interstingly,ps aux
will showa
gpg-agent
process after running the command.=> this process is no running when used in a shared folder
What versions of software are you using?
Operating system: (
uname -a
) …=> Alpine 3.15.2 via docker
git-secret
path: (which git-secret
) …git-secret
version: (git secret --version
) …git
version: (git --version
) …Shell type and version: (
$SHELL --version
) …not working
gpg
version: (gpg --version
) …The text was updated successfully, but these errors were encountered: