You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Open Repository in Container does not work with private repos (even if credential manager setup) #1578
I currently have a Git credential manager setup locally and am able to do Git operations inside a container as a result. However, when using the Open Repository in Container feature, I get an error after entering a private repo.
Steps to Reproduce:
Setup a git credential manager on your local machine
Start VS Code and run Open Repository in Container...
Enter a private GitHub repo
Expected: Repo clones
Actual: Clone fails
The initialization of the Alpine container used to clone would need to also use the same git credential forwarding and .gitconfig copying logic for this to work. If we initially only support public repos, a better error message would be helpful.
Logs:
Cloning Github repository: /chuxel/headless-test-projects into volume vsc-headless-test-projects-40adf18d76930542611ebc65a3a433de
Run: docker run --rm --mount src=vsc-headless-test-projects-40adf18d76930542611ebc65a3a433de,dst=/chuxel/headless-test-projects,type=volume,volume-driver=local alpine/git clone https://github.com/chuxel/headless-test-projects.git /chuxel/headless-test-projects
Cloning into '/chuxel/headless-test-projects'...
fatal: could not read Username for 'https://github.com': No such device or address
We can register a credentials helper. One limitation is that we need Node.js in the container to run the code we have for that. That increases the initial download size for the git clone image.
Currently alpine/git: 27.5MB node:12 that comes with git installed: 908MB
Adding Node.js to alpine/git: 54.8MB
I'll park the commit switching over in a PR because the images differ that much in size. We could probably publish our own image (and e.g. also include the docker CLI).
A limitation with the credentials helpers is that it wouldn't solve the case where the credentials are not yet available on the local machine. For that we could look into allowing the user to type in their credentials in the terminal.
Erich Gamma (@egamma) Should have mentioned that in the PR too: There is also the concern that the image is quite large (#1578 (comment)). Without publishing our own image, we could build one locally based on alpine/git and add Node.js to it. Or maybe there is a suitable one on Docker Hub I haven't found yet.
Activity
egamma commentedon Oct 3, 2019
Private repos are not yet supported.
chrmarti commentedon Dec 2, 2019
We can register a credentials helper. One limitation is that we need Node.js in the container to run the code we have for that. That increases the initial download size for the
git cloneimage.Currently
alpine/git: 27.5MBnode:12that comes withgitinstalled: 908MBAdding Node.js to
alpine/git: 54.8MBI'll park the commit switching over in a PR because the images differ that much in size. We could probably publish our own image (and e.g. also include the docker CLI).
chrmarti commentedon Dec 2, 2019
A limitation with the credentials helpers is that it wouldn't solve the case where the credentials are not yet available on the local machine. For that we could look into allowing the user to type in their credentials in the terminal.
egamma commentedon Dec 2, 2019
Closing this one so that the current behaviour gets tested and extracting the limitation into a separate issue.
chrmarti commentedon Dec 3, 2019
Erich Gamma (@egamma) Should have mentioned that in the PR too: There is also the concern that the image is quite large (#1578 (comment)). Without publishing our own image, we could build one locally based on
alpine/gitand add Node.js to it. Or maybe there is a suitable one on Docker Hub I haven't found yet.chrmarti commentedon Dec 4, 2019
Moving to December. (We reverted the final change.)