envbuilder clone a private git repository?
- I've added my Coder SSH public key to github.
- I'm using a template based on the aws-devcontainer template.
- I set repo_url to [email protected]:foo/bar
Envbuilder fails to authenticate:
After the fall back image starts, I can
git clone
and the agent ssh successfully authenticates.
I'm guessing envbuilder is trying to clone the repo before the agent is pulled by the ENVBUILDER_INIT_SCRIPT. I think the logs corroborate that.
Is there a way to get the clone to work the first startup?Solution:Jump to solution
@David
envbuilder
is a bit specific and requires extra work to get the SSH key inside the workspace, you'll have to set either ENVBUILDER_GIT_SSH_PRIVATE_KEY_PATH
or ENVBUILDER_GIT_SSH_PRIVATE_KEY_BASE64
from data.coder_workspace_owner.me.ssh_private_key
's contents
see https://github.com/coder/envbuilder/issues/333 for more context
I'd also suggest you'd look into using External Auth, which could make it easier for you...3 Replies
<#1359681136967684137>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Solution
@David
envbuilder
is a bit specific and requires extra work to get the SSH key inside the workspace, you'll have to set either ENVBUILDER_GIT_SSH_PRIVATE_KEY_PATH
or ENVBUILDER_GIT_SSH_PRIVATE_KEY_BASE64
from data.coder_workspace_owner.me.ssh_private_key
's contents
see https://github.com/coder/envbuilder/issues/333 for more context
I'd also suggest you'd look into using External Auth, which could make it easier for youthat said, i think we should be able to set the
ENVBUILDER_GIT_SSH_*
stuff by default in our example templates to avoid this