Skip to content

Open Repository in Container does not work with private repos (even if credential manager setup) #1578

Closed

Description

@Chuxel

Related to #1515

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:

  1. Setup a git credential manager on your local machine
  2. Start VS Code and run Open Repository in Container...
  3. 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.

image

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

Version: 1.39.0-insider (user setup)
Commit: 695ee74864ef93d10f5de0861cb66af190e76211
Date: 2019-10-02T08:56:48.092Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
Extension version: 0.79

//cc: Erich Gamma (@egamma)

Activity

  1. egamma commented on Oct 3, 2019

    @egamma
    Member

    Private repos are not yet supported.

  2. chrmarti commented on Dec 2, 2019

    @chrmarti
    Contributor

    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).

  3. chrmarti commented on Dec 2, 2019

    @chrmarti
    Contributor

    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.

  4. added
    verification-needed
    on Dec 2, 2019
  5. egamma commented on Dec 2, 2019

    @egamma
    Member

    Closing this one so that the current behaviour gets tested and extracting the limitation into a separate issue.

  6. chrmarti commented on Dec 3, 2019

    @chrmarti
    Contributor

    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.

  7. added
    containers
    feature-request
    and removed
    verification-needed
    on Dec 4, 2019
  8. chrmarti commented on Dec 4, 2019

    @chrmarti
    Contributor

    Moving to December. (We reverted the final change.)

  9. added
    plan-item
    and removed
    feature-request
    on Jan 13, 2020
  10. locked and limited conversation to collaborators on Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersplan-item

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions