I'm trying to do fetch a dependency (mix deps.get) in a dagger withExec, but it fails with Host key verification failed when hex attempts to fetch a private git repo. Running ssh-add -l on the host machine lists the correct key. Is there anything special I need to do in order to forward the ssh agent to the dagger container? I'm using the 1password ssh agent.
#1password git ssh agent forwarding to dagger container
1 messages · Page 1 of 1 (latest)
hey there! @bitter grove
by default your Dagger steps don't have access to your host for security reasons. You need to explicitly pass the SSH_AUTH_SOCK to your function. Here's an example:
cc @dry ingot it'd be nice to have a cookbook entry for this
note to myself: finish my discord AI agent to automate this. cc @short comet 🙈
Thanks! Though I don't need it anymore, got the motivation I needed to move our internal deps to a private hex repo 😅
@fair epoch we have an example which doesn't require passing the socket - can you clarify how it differs from above? is it because of using a package manager instead of dag.git directly? https://docs.dagger.io/cookbook/#clone-a-remote-git-repository-into-a-container-by-branch-tag-or-commit
I think that example doesn't work Vikram. Accessing private repos without explicit credentials is only possible when calling private modules or sending a URL path via a function argument.
I'm AFK right now but I can confirm a bit later
Ok please lmk, we have a few examples which refer to private repositories in the cookbook and none of them pass a socket, so maybe they all need to be changed? Also @vagrant wigeon for comments
doesn't work for me @dry ingot as I supposed.
let's wait for @vagrant wigeon 's reply here
Yes exactly -- but this should already be documented in this docs that I'm gonna finally review tomorrow: https://github.com/dagger/dagger/pull/9770 -- the underlying root cause is the same, and the user's example on the other help channel is . Marcos you're 100% right 🙏
Thx Guillaume
One request: that PR already updates some of the cookbook recipes but could you please double-check in case we missed any?