microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.66k stars 286 forks source link

Remote-Containers: Clone Repository in Container Volume doesn't work behind proxy #7143

Open kse3hi opened 2 years ago

kse3hi commented 2 years ago

Steps to Reproduce:

  1. Press "F1" > Select "Remote-Containers: Clone Repository in Container Volume" > Select: "Clone a repository from GitHub in a Container Volume"
  2. Select Repo and branch Repo contains .devcontainer folder with Dockerfile with:
    ...
    ENV HTTP_PROXY="${http://host.docker.internal}:${3128}"
    ENV HTTPS_PROXY=...
    ...

    Expectation:

    • repo should be cloned and Devcontainer with proper setup should be created.

Observation:

Remote-Container Issue.log

bamurtaugh commented 2 years ago

cc @chrmarti transferring from vscode-dev-containers to vscode-remote-release as I believe this is more extension specific.

OneCyrus commented 2 years ago

Same issue here. Clone doesn’t use the devcontainer and dockerfile from the repo but bootstraps with a generic dockerfile/image. there should be a way to at least customize the bootstrapped dockerfile for cloning.

kse3hi commented 2 years ago

Additional information: Environment: Dev Containers 0.255.4 in VS Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075) Looks like operating with docker under cloned repository performed in the container [139289 ms] Start: Run in container: docker volume ls -q Therefore question: If I defined proxy settings on my host machine via .docker/config.json, including PROXY settings, will be this setting applied with operating with docker in bootstrap container?

Looks like it is exactly the issue - therefore no proxy are applied - everything is failing with error as: #13 11.09 fatal: unable to access 'https://github.com/ohmyzsh/ohmyzsh/': Could not resolve host: github.com

Same Dockerfile (DevContainer) works perfectly if you first clone it locally and perform: "DevContiner:Open Folder in Container. "

new_logs.log

Success log with local cloning: remoteContainers-2022-10-17T14-15-19.682Z.log

matejetz commented 1 year ago

I have the exact same issue, container creation with locally checked out repo works fine but "Clone a repository from GitHub in a Container Volume" fails. At first it failed because the bootstrap image didn't have git-lfs installed even though its a feature in our devcontainer. After manually adding it to the bootstrap.Dockerfile it now fails with the Could not resolve host: ... errors although docker client is configured to use the proxy and is working for all other containers.