Just a small question:
The README explains that one has to mount /root/project as a host directory (or volume) to have a place to save their projects. Now i'd like to know where in the container the installed plugins, themes and VS Code settings are stored, so that i could mount it to a host directory (or volume) as well, to preserve installed plugins during container recreations.
I assume this is where -d, --data-dir initially points to, but where is that? If i just specify another folder and mount it, is code able to start up if this directory doesn't exist? If i mount an initally empty host directory to this path, will code be able to start up, not having problems with the folder's emptiness?
@simonszu You can see similar log info for README.md docker run command:
INFO code-server development
INFO Additional documentation: http://github.com/codercom/code-server
INFO Initializing {"data-dir":"/root/.local/share/code-server","working-dir":"/root/project","log-dir":"/root/.cache/code-server/logs/20190312143205158"}
... ...
You should know about some docker mount volume. For example, I have installed extensions to test:
root@8665d72aeaea:~# ls .local/share/code-server/
CachedExtensions dependencies extensions globalStorage languagepacks.json machineid rapid_render.json self-signed.cert self-signed.key User
root@8665d72aeaea:~# ls .local/share/code-server/extensions/
ms-python.python-2019.2.5558
So, you can do use similar command(e.g.: I use /home/centos/yancy to save data. Your code or workspace will in your current directory, you can also change it):
[yancy@localhost auto-deploy]$ docker run -t -v /home/centos/yancy:/root/.local/share/code-server/ -p 8443:8443 -v "${PWD}:/root/project" codercom/code-server --allow-http --no-aut
h
We'll be fixing this so binaries extract to a temporary location. Then you'll be able to share the data-dir
@simonszu One of the ways is using Bind volumes. You can bind it on the host HDD to the container for persistence.
Not sure my problem is similar, but even after installing an extension, .local/share/code-server/extensions/ is empty, after refreshing browser, the extension in vscode says its installed but it is greyed out, I have to uninstall it and reinstall it to have it working every time
Everything now extracts to a tmp dir, mounting extensions should work! :confetti_ball:
Most helpful comment
We'll be fixing this so binaries extract to a temporary location. Then you'll be able to share the data-dir