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

add docker-credential-helper to gitpot-cli #8228

Closed
wants to merge 3 commits into from

Conversation

tbutter
Copy link

@tbutter tbutter commented Feb 15, 2022

Description

This allows you to use gitlab.com credentials for docker using gitpod-cli.
It's currently only working for gitlab and I am looking for feedback if that's the right way to do it before adding other providers.

Requires an additional file in the workspace docker image:
/usr/bin/docker-credential-gp

#!/bin/bash
gp docker-credential-helper "$@"

and in /home/gitpod/.docker/config.json

{
        "auths": {},
        "credsStore": "gp"
}

How to test

open a private gitlab repo context and then use docker pull to pull a private image from the gitlab registry.

Release Notes

Documentation

not sure

@roboquat
Copy link
Contributor

@tbutter: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@csweichel
Copy link
Contributor

Thanks @tbutter, that makes a ton of sense to me.

Re integration: we have a process in supervisor already which establishes symlinks, e.g. for /usr/bin/gp. We could use that very process to establish a symlink for /usr/bin/docker-credential-gp. Further, we could consider creating/patching the ~/.docker/config.json file on supervisor (or docker-up?) startup.

@gtsiolis
Copy link
Contributor

gtsiolis commented Feb 25, 2022

Thanks for contributing, @tbutter! 🧡

You'll also need to sign a Contributor License Agreement (CLA)[1] once before merging your first contribution. Looping in @meysholdt to reach out about the CLA. 🏓

@stale
Copy link

stale bot commented Mar 9, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added meta: stale This issue/PR is stale and will be closed soon and removed meta: stale This issue/PR is stale and will be closed soon labels Mar 9, 2022
@tbutter
Copy link
Author

tbutter commented Mar 9, 2022

@csweichel Thanks. I could not figure out a way to test the supervisor code locally/in gitpod. Are there any docs on how to do it?
@meysholdt Can you send me the CLA to sign?

@stale
Copy link

stale bot commented Mar 19, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Mar 19, 2022
@tbutter
Copy link
Author

tbutter commented Mar 23, 2022

Thanks for contributing, @tbutter! 🧡

You'll also need to sign a Contributor License Agreement (CLA)[1] once before merging your first contribution. Looping in @meysholdt to reach out about the CLA. 🏓

Is there anything I can do to support the CLA process?

@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Mar 23, 2022
@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 24, 2022

Is there anything I can do to support the CLA process?

@tbutter Sorry this is taking longer than usual but please bare with us as most of the company is currently at our offsite, we'll get back to this next week. 🎗️

@meysholdt
Copy link
Member

hi @tbutter! Can you send an email with your real name to [email protected]? Then I can email you the CLA. Apologies for the late response - as George said, we all were at a company offsite last week.

@stale
Copy link

stale bot commented Apr 11, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Apr 11, 2022
@stale stale bot closed this Apr 16, 2022
@@ -364,6 +364,19 @@ func Run(options ...RunOption) {
wg.Wait()
}

func installDockerConfig() {
const dockerConfigPath = "/home/gitpod/.docker/config.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the HOME variable instead of hardcoding the path here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if its set at that stage and have no way to test it.
All other install functions in supervisor.go also hardcode the path.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, np. Other than that, please sign the CLA fast so that we can get this merged! 🚀 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I signed the CLA on March, 31st.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axonasif what can I help to bring this MR forward?
the helper works. i assume the supervisor works too (but can't test locally)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also looks like we can't reopen the PR anymore. Can you please create a new one?
Screenshot 2022-05-11 at 8 07 05 AM

@shaal
Copy link
Contributor

shaal commented Apr 29, 2022

I have a similar issue - shaal/DrupalPod#87
I want to be able to use the same git access provided by gp credential-helper inside docker-compose container (ddev), so I can clone private projects, and run composer just like I can do in Gitpod.

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

Successfully merging this pull request may close these issues.

8 participants