Is there a way to install VS Code extensions in a Dockerfile?
If your goal is not to repeat the installation of the VS code extensions, my suggestion is to mount $HOME/.vscode-server/.
For example, in a docker-compose.yml
services:
your_container:
...
volumes:
- ./volume/vscode-server:$HOME/.vscode-server
Or in docker run
docker run -it -v ./volume/vscode-server:$HOME/.vscode-server your_image bash
Then, install the required extensions inside the container. The next time you set up the container, there will be no need to reinstall extensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With