I'm attempting to run Visual Studio Code within a Docker container. I've started the container with a variety of options, such as using `--privileged`, `--network host`, and more. Additionally, I've mounted some necessary sockets from the host and set several environment variables for X11. While VSCode launches fine, I run into problems when trying to install extensions, receiving a 'Failed to fetch' error. Interestingly, when I try to `curl` the same URL that fails in VSCode, it works perfectly. Given that I started the container with `--network host`, I expected the network would pass through without issues. Does anyone know what might be going wrong?
2 Answers
Instead of trying to run standalone VSCode, you might want to consider using `code-server` from Coder. It's designed to run VSCode in a server environment and can handle such setups more smoothly, especially in multi-developer scenarios.
It sounds like you're facing some network permission issues within the container. Have you checked the proxy settings inside your container? Sometimes, even with `--network host`, applications like VSCode might need specific configurations to access the internet due to Docker's isolation features. Try setting the `HTTP_PROXY` or `HTTPS_PROXY` environment variables if that applies to your network setup.
I haven't looked into that yet! I'll give it a try and see if it resolves the fetching issue.

That's definitely an interesting option! I'm aiming for a solution where various IDEs can work seamlessly within the same environment, but I'll keep `code-server` in mind.