'preinstall VScode remote extensions in a docker container

I'm currently using the vscode extension to attach to running containers in Kubernetes as described here: https://code.visualstudio.com/docs/remote/attach-container.

When attaching vscode will install some extensions in the remote container - this works reliably, but it quite slow.

Is it possible to figure out how to install these extensions into the base image so that remote connection can happen quickly?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source