dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.84k stars 666 forks source link

How to preinstall Onisharp and related required dependencies for dev containers? #4735

Open pourmand2010 opened 3 years ago

pourmand2010 commented 3 years ago

Every time we start a dev container for .NET, we see that these dependnecies are getting intalled:

Installing C# dependencies...
Platform: linux, x86_64, name=ubuntu, version=18.04

Downloading package 'OmniSharp for Linux (x64)' (36011 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Linux (x64)'

Downloading package '.NET Core Debugger (Linux / x64)' (3411 KB).................... Done!
Installing package '.NET Core Debugger (linux / x64)'

Downloading package 'Razor Language Server (Linux / x64)' (61682 KB).................... Done!
Installing package 'Razor Language Server (Linux / x64)'

Finished

Is there a way that we embed these dependencies and extensions once inside our docker images so that they are there always?

Because we have an infrastructure that deletes containers randomly (chaos engineering), the current behaviour is extremely inefficient. Each time a container comes up we have to wait a lot to see these dependencies being installed.

JoeRobich commented 3 years ago

You could follow these instructions to building a package which includes all the dependencies.