Skip to content
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

ssh key docs #2

Open
tdealtry opened this issue Jul 12, 2023 · 2 comments
Open

ssh key docs #2

tdealtry opened this issue Jul 12, 2023 · 2 comments

Comments

@tdealtry
Copy link

Hi @guiguem Again you mentioned this in Tokai - I'm just adding an issue here while I'm on a roll

You mentioned there's a way to run the docker image forwarding your local system ssh key into the image so you can use it directly there without having to setup the permissions for git clone/push/pull/etc. - it'd be good to document this in the README.md of a package. Probably this one?

[Having said that, this documentation is not important if we choose gitlab, which we can't use ssh keys with...]

@guiguem
Copy link
Collaborator

guiguem commented Jul 13, 2023

Hi! great point, please keep rolling!

Yes technically, it seems we need two things for using the ssh agent when building the image locally:

  • have BUILDKIT enabled (in most recent docker installation, this is enabled by default).
    This can be done by either doing export DOCKER_BUILDKIT=1 or prepending the docker build command with DOCKER_BUILDKIT=1 (like DOCKER_BUILDKIT=1 docker build ...
  • need to expose the ssh agent socket
docker build --ssh default .

Therefore the total command to be sure it will work is:

DOCKER_BUILDKIT=1 docker build --ssh default .

I will update the README about these commands: please let me know if these work for you.
I guess this is a general thing that impacts all the HK packages (since they are all installed by ssh), but maybe people are more likely to build the entire software stack: I guess, my question is "is it fine to put this documentation only in hk-software or should we add this elsewhere?"

@guiguem
Copy link
Collaborator

guiguem commented Aug 24, 2023

I think I have added the documentation correctly, can you check @tdealtry ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants