Jump to content
linuxserver.io

[Support] Linuxserver.io - Code-server

174 posts in this topic Last Reply

Recommended Posts

linuxserver_medium.thumb.png.77839350903a17735a207d8fa9d33a08.png

Application Name: Code-server

Application Site: https://coder.com/

Docker Hub: https://hub.docker.com/r/linuxserver/code-server/

Github: https://github.com/linuxserver/docker-code-server

 

Please post any questions/issues relating to this docker you have in this thread.

 

If you are not using Unraid (and you should be!) then please do not post here, instead head to linuxserver.io to see how to get support.

Share this post


Link to post

This may be specific to Code Server itself and not this container, but how do we tell VSCode the subdirectory path it's located on in a reverse proxy?

Share this post


Link to post
1 hour ago, ZooMass said:

This may be specific to Code Server itself and not this container, but how do we tell VSCode the subdirectory path it's located on in a reverse proxy?

We have not made a proxy confs for subdirectory. Didn't find an option to set a prefix for subfolder in code-servers documentation.

Share this post


Link to post

Stupid question numero uno.. how do you "log out" once you're in when password is used to secure?

PS. This is a freaking awesome tool when I'm about with the ChromeBook.

Edited by Saldash

Share this post


Link to post
1 hour ago, Saldash said:

Stupid question numero uno.. how do you "log out" once you're in when password is used to secure?

PS. This is a freaking awesome tool when I'm about with the ChromeBook.

 

Don't think there is one.

Share this post


Link to post

Hi linuxserver team,

 

I have a question on the usage of this container. In the container form coder.com I am able to install languages such as python etc through the terminal form within the VS Code. The terminal in this version is very limited, no "sudoer". How do I go about installing languages to this container?

 

Thank you.

 

Update: So apparently I have to go to the console via unraid to get to root console and install my languages, this seems a bit counter productive as I am unlikely to have access to said console when I am outside. Is there a better/proper way to install packages when I am out an about?

Edited by aelindgard
update

Share this post


Link to post
On 7/5/2019 at 11:54 PM, aelindgard said:

Hi linuxserver team,

 

I have a question on the usage of this container. In the container form coder.com I am able to install languages such as python etc through the terminal form within the VS Code. The terminal in this version is very limited, no "sudoer". How do I go about installing languages to this container?

 

Thank you.

 

Update: So apparently I have to go to the console via unraid to get to root console and install my languages, this seems a bit counter productive as I am unlikely to have access to said console when I am outside. Is there a better/proper way to install packages when I am out an about?

Root access in gui terminal is not very secure, the official container running as root is also not secure.

 

If you want to add packages to this container and you want them to be persistent, use the custom scripts feature in our baseimages. Keep in mind that we cease to provide further support once you enable that so you will be on your own.

 

Create a folder under /config called "custom-cont-init.d" and inside it place a file with "apt-get update && apt-get install -y blah"

 

That script will be run on every container start and will survive container recreation

 

Dev info here: https://github.com/linuxserver/docker-baseimage-ubuntu/blob/bionic/root/etc/cont-init.d/99-custom-scripts#L14-L31

Share this post


Link to post

Install was really smooth, thank you!

Does anybody know how to get the command window to open up in the browser window?

The window I am talking about is opened by hitting CTRL+Shift+P in the Windows VSCode application, but doing that in browser does not work.

 

image.thumb.png.84179725200fc7baf8557b75e580756e.png

Edited by Mattyfaz
Added info

Share this post


Link to post
19 hours ago, aptalca said:

Root access in gui terminal is not very secure, the official container running as root is also not secure.

 

If you want to add packages to this container and you want them to be persistent, use the custom scripts feature in our baseimages. Keep in mind that we cease to provide further support once you enable that so you will be on your own.

 

Create a folder under /config called "custom-cont-init.d" and inside it place a file with "apt-get update && apt-get install -y blah"

 

That script will be run on every container start and will survive container recreation

 

Dev info here: https://github.com/linuxserver/docker-baseimage-ubuntu/blob/bionic/root/etc/cont-init.d/99-custom-scripts#L14-L31

Thank you for your reply.

 

I agree about the need for security as I imagine a fair number would be linking this to an instance of gitlab or other code managers. I just find it odd that the files needed to run what is being developed is not there.

 

Would you consider setting up the code-server user as a sudoer with limited privileges using command alias a safer option?

Share this post


Link to post
15 hours ago, aelindgard said:

Thank you for your reply.

 

I agree about the need for security as I imagine a fair number would be linking this to an instance of gitlab or other code managers. I just find it odd that the files needed to run what is being developed is not there.

 

Would you consider setting up the code-server user as a sudoer with limited privileges using command alias a safer option?

After thinking about it, here's a PR with sudo access via an optional SUDO_PASSWORD variable: https://github.com/linuxserver/docker-code-server/pull/3

Share this post


Link to post

Hey, and thanks for the awesome container! Looking good so far, only I haven't figured out how to save or load vscode workspace files yet. Does the container support loading workspace files or should I do it some other way (there's the workspace folder under config)?

 

BTW: I have no issues running the container in a subdirectory behind reverse proxy, although I am not using password authentication.

Share this post


Link to post
15 minutes ago, sam19 said:

Hey, and thanks for the awesome container! Looking good so far, only I haven't figured out how to save or load vscode workspace files yet. Does the container support loading workspace files or should I do it some other way (there's the workspace folder under config)?

 

BTW: I have no issues running the container in a subdirectory behind reverse proxy, although I am not using password authentication.

I have no idea how the workspace files work, but there is Open workspace.. In the file menu. Your files must be accessible by the container, so you Will probably have to add a new volum mount with the files in the workspace file, and I guess they have to have the same path also.

 

There is a add workspace folder short ut in the welcome screen.

 

You really should not reverse proxy this withput setting a password! It's now Open for all the world to use.

Share this post


Link to post

Hey, thanks for the answer! Yes, obviously I have other measures in place to prevent that :) I have a number of workspaces in a folder that I have mounted. However, the file names are grayed out when I browse to them through "Open Workspace" and cannot be selected. I just realized that when using "Save Workspace As" it doesn't save anything in the path that you give it, but instead saves some files in /config/data/User/workspaceStorage/<long random string>/. I still haven't figured out how I could open a workspace from that location.

Share this post


Link to post

I don't even know what workspace files are.

 

My workflow is, open terminal, go to workspace folder, git clone whatever, then from the top menu, open folder, select the cloned folder.

 

Anything under the config folder is accessible by vscode. Also /config is the home of the user running vscode so things that vscode creates will likely be relative to that folder

Edited by aptalca

Share this post


Link to post

Thank you for your reply, @aptalca! Workspaces are, at least in my opinion, one of the most useful features in VSCode. You can save individual settings per workspace, based on the project's needs. They are also not limited to the existing folder structure, instead you can add folders outside the working folder to your workspace. For example I have common tools that I use in all of my Nextcloud apps, and I can add this folder in all of my app workspaces, so the tools stay up-to-date every time I update them. There are surely more features to them, but these are the most useful ones to me personally. A workspace file is just a file containing the configuration of your workspace, saved as a .code-workspace file on the disk.

 

I think workspaces would be more useful if you mostly work on multiple projects alone or mostly maintain them yourself. If you just clone an individual repo to work on an issue and after that want to clear the desk for the next thing on your list, I don't think you would benefit from using workspaces. Currently it's a bit confusing, as the app's menu's contain options such as "Open Worspace" and "Save Workspace As", but the functionality is missing.

 

Here are a couple of topics explaining VS Code workspaces:

https://code.visualstudio.com/docs/editor/multi-root-workspaces (official documentation)

https://stackoverflow.com/questions/44629890/what-is-a-workspace-in-vs-code (discussion on the subject on StackOverflow)

Edited by sam19
Clickable hyperlinks

Share this post


Link to post

I tested Save Workspace As in the coder container and it's the same there, so it's an issue with code-server. If it's not reported already, you should make an issue at their github.

Share this post


Link to post

Hi there,

 

Trying to mess with this docker for a few days, however i can't install node.js and get a react environnement working. The node.js install does not work. It seems i have to install the runtime environment OUTSIDE the docker. But i am not sure how. And when i get it working just a while (installing inside the docker, but does not stick when i restart it) and i npm create-react-app, i can't access the app page on my network, 

 

Have any of you guys made it work?

 

cheers

 

Edit 1: OK, i've figured out half my problem. You need to open port 3000 for the create react app to function. And after that it works great. However i still have a small problem, the terminal never access the bash profile of nvm so everytime i open a new terminal in vs code, i need to retype  :

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion


Do you guys know how to fix this?

Edited by Troussdesoin

Share this post


Link to post

How do you install Node.js extension?  It says it is on to low of a version 1.33.1?  

 

"Unable to install because, the extension 'dbaeumer.vscode-eslint' compatible with current version '1.33.1' of VS Code is not found."

 

Any ideas?!

Share this post


Link to post
6 hours ago, GreenEyedMonster said:

How do you install Node.js extension?  It says it is on to low of a version 1.33.1?  

 

"Unable to install because, the extension 'dbaeumer.vscode-eslint' compatible with current version '1.33.1' of VS Code is not found."

 

Any ideas?!

You'll have to wait. 1.33 is the latest stable version: https://github.com/cdr/code-server/releases

Share this post


Link to post
2 hours ago, GreenEyedMonster said:

Makes sense!  Thanks!  :)

I'll look into creating a "development" tag for their beta releases. It looks like they release them on a sensible schedule.

Share this post


Link to post
On 9/17/2019 at 1:20 PM, aptalca said:

I'll look into creating a "development" tag for their beta releases. It looks like they release them on a sensible schedule.

Will the "development" tag be equivalent to coder's v2 tag (that I am currently using)?

How about just following coder's tagging structure, e.g. what will v3 be if development is v2? 

Share this post


Link to post
On 7/8/2019 at 4:33 AM, aptalca said:

Root access in gui terminal is not very secure, the official container running as root is also not secure.

 

If you want to add packages to this container and you want them to be persistent, use the custom scripts feature in our baseimages. Keep in mind that we cease to provide further support once you enable that so you will be on your own.

 

Create a folder under /config called "custom-cont-init.d" and inside it place a file with "apt-get update && apt-get install -y blah"

 

That script will be run on every container start and will survive container recreation

 

Dev info here: https://github.com/linuxserver/docker-baseimage-ubuntu/blob/bionic/root/etc/cont-init.d/99-custom-scripts#L14-L31

I need to install DotNet Core SDK 3, which has several dependencies that are not installed, and it needs to be configured for container use.

Should I 1) attempt the custom scripts path, or am I better off 2) creating my own docker file that inherits from your image as base, or 3) fork and modify your dockerfile to also include the DotNet SDK steps?

See: https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile

 

Share this post


Link to post
1 hour ago, ptr727 said:

Will the "development" tag be equivalent to coder's v2 tag (that I am currently using)?

How about just following coder's tagging structure, e.g. what will v3 be if development is v2? 

development tag is already live.

 

Going forward, latest will be stable releases from their github and development will be pre-releases from their github, whatever version they may be

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.