Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devcontainer extension caching - Current Best Practice?

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

enter image description here

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?

like image 670
Justin Grote Avatar asked Sep 14 '26 05:09

Justin Grote


2 Answers

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.

like image 116
zephyros Avatar answered Sep 16 '26 08:09

zephyros


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/
like image 22
Moon Avatar answered Sep 16 '26 08:09

Moon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!