The advanced container guide says you should mount a volume to the extensions folder to cache the extensions, however this setting also exists:

This setting appears to mount a named /vscode volume and then symlink extensions into your .vscode-server-insiders folder.
So is the above guidance out of date and needs to be replaced with this setting or is the guidance still useful?
Here I was wondering why the extensions keep on reinstalling. I followed the advanced devcontainer guide and mounted the extensions manually, and it seems the new vscode setting conflict with the old instruction. The old instruction is no longer needed if you use the new vscode settings.
This is my workaround. VSCode automatically creates .vscode-server/ directory in /root inside the container. Thus, it won't install them again by mounting the extension metadata and its binary cache.
services:
some-service:
image: someimage
volumes:
- .vscode-server/extensions/:/root/.vscode-server/extensions/
- .vscode-server/extensionsCache/:/root/.vscode-server/extensionsCache/
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