How Do I Run VSCode Inside a Docker Container?

0
2
Asked By CuriousCat92 On

I'm working on a project where I need to run Visual Studio Code (VSCode) inside a Docker container, but I'm running into issues installing extensions. I've launched my container with a variety of flags, including `--privileged` and `--network host`, and I've also mounted several X11 and D-Bus sockets from my host system. Despite being able to run VSCode without problems, I get an error message when I try to install extensions, specifically `error GET Failed to fetch`. I've checked the network connection, and I can `curl` the URLs successfully from inside the container, so I get the sense that the network is functioning properly. Does anyone have insights on what I'm missing or how to troubleshoot this? Thanks!

2 Answers

Answered By DockerDude42 On

Have you considered using code-server instead? It lets you run VSCode in the browser, and it could simplify your setup. Check out the code-server GitHub page for details!

CuriousCat92 -

That's definitely an interesting option! However, I'm focusing on running a standalone instance of VSCode inside the container to ensure it works for my use case with all IDEs. I just want to make sure that VSCode is fully functional right out of the box.

Answered By TechieTom67 On

Have you looked into using devcontainers? It might solve your problem since VSCode has built-in support for them. You can check out the official guide here: Dev Containers: Getting Started. It could be a more straightforward solution for your setup!

CuriousCat92 -

I appreciate the suggestion! I'm aware that VSCode has remote development features, but my goal is to create a devcontainer image that works for around 150 developers at my company, allowing flexibility in IDE usage. I'm aiming to ensure that VSCode runs smoothly inside the container, as not all IDEs have devcontainer support.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.