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.64k stars 285 forks source link

Q: Using VSCode DevContainers in offline environment #10356

Open hinogi opened 3 days ago

hinogi commented 3 days ago

So using docker in offline scenarios is annoying enough but devcontainers seem to be even worse. Is there any guide that explains how to use docker devcontainer with only the containers available on the docker host and no internet connection? One thing I already found out, if you kill the try to use wget on the remote host the fallback is to install from the current machine which let you use devcontainer cli. As soon as you try to inspect a volume with a devcontainer it defaults to an alpine image which might or might not be around. Which will fail if not around but will not terminate. Also, if I connect to a remote docker host via ssh and then try to use devcontainers without internet connection even with an image that is already there it hangs in Resolving Remote even in an empty folder git rev-parse --show-cdup which also does not terminate and will run forever.

So from every angle it seems that an internet connection must be available but is that really necessary?

### Tasks
joshspicer commented 3 days ago

I've had personal success in the past building the dev container in the past (leaving it open on my laptop) and then going offline (in this case, on a plane). I don't believe the extension is regularly tested in an offline scenario, nor do we have specific documentation on that scenario

hinogi commented 3 days ago

It would be also good to know how to start one yourself like docker/devcontainer cli wise. It is a bit opaque what is happening when you hit inspect volume in devcontainer or checkout repo in container volume or reopen folder in container. I can do the manual work when I know what has to be done. Having the typescript node image around is not enough since that only starts node when fired up.

joshspicer commented 10 hours ago

It would be also good to know how to start one yourself like docker/devcontainer cli wise.

With the dev container CLI, you can start up a dev environment with devcontainer up --workspace-folder <path-to-workspace>

The dev container CLI can be installed from a command in VS Code, or with npm (npm install -g @devcontainers/cli)

Those commands are wrap additional functionality and call the dev container CLI when applicable. Does that help?