How can we open default folder in VSCode while running in container
How can we open default folder in VSCode while running in container. -v "$PWD:/home/coder/project" is not working how to give base-path @code-asher
I have the same issue, can't open project files
You can pass it on the command line. For example something like:
docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" codercom/code-server /home/coder/project
Also check out https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-does-code-server-decide-what-workspace-or-folder-to-open
" -v "$PWD:/home/coder/project" this argument is not working for me. "docker run -it -p 127.0.0.1:8080:8080 codercom/code-server /home/coder/project" this works fine for me. why you are using " -v "$PWD:/home/coder/project" ? @code-asher
That mounts your current directory into /home/coder/project in the Docker container. If you use that you should see the contents of that directory when you do ls /home/coder/project inside the Docker container.
You might want to mount your project instead of just using the current directory, for example -v /path/to/my/project:/home/coder/project. If you don't want to mount anything into the Docker container then you can skip this, but keep in mind if the Docker container shuts down the files will be lost.
Also check out https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-does-code-server-decide-what-workspace-or-folder-to-open
Sorry for posting in this closed issue but I have a question and don't want to open a new issue.
Does anyone know if there is a way to open a workspace/folder from the terminal??
In the desktop version I believe you can run code /xxx/yyy/zzz.workspace...
Reason is I have an init script which I run after upgrading versions which re-installs node & my local tools and I want that to also just open the project workspace too.
Not yet but we want to add a way: https://github.com/cdr/code-server/issues/164
Er, that's assuming you want to open the folder/workspace in the existing code-server window. If that's not what you meant let me know.
Oh that is exactly what I am asking. I did try search for similar issues but wasn't searching the right words. 👍
Starting code-server with the working directory as the last arguement, eg: code-server --bind-addr 0.0.0.0:9870 /working/directory This worked for me.