Skip to content

Docker: Settings/extensions not saved #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Merith-TK opened this issue May 20, 2019 · 16 comments
Closed

Docker: Settings/extensions not saved #703

Merith-TK opened this issue May 20, 2019 · 16 comments
Labels
bug Something isn't working

Comments

@Merith-TK
Copy link
Contributor

Merith-TK commented May 20, 2019

  • code-server version: Latest Docker as of may 20, 2019. 1145am PST-8
  • OS Version: Ubuntu Server 18.04

Description

Does not save settings/extensions at all

Steps to Reproduce

fresh docker image, (sudo apt install docker.io, docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth)

open terminal in code-server
then touch ~/persistence_test

then stop the docker image, and relaunch it, ~/persistence_test does not exist

@Merith-TK Merith-TK added the bug Something isn't working label May 20, 2019
@Merith-TK
Copy link
Contributor Author

##Updated text for specifics

@Merith-TK
Copy link
Contributor Author

bump?

@deansheather
Copy link
Member

The docker run command you're running is mounting the current directory on the host to /home/coder/project in the container (-v "${pwd}:/home/coder/project"). This means that only the content in /home/coder/project will be persisted across sessions.

You can add more -v flags when using docker run to mount more directories if you need, like the following to persist settings and extensions between containers (untested):

-v "$HOME/.config/Code/User:/home/coder/.local/share/code-server/User" -v "$HOME/.vscode/extensions:/home/coder/.local/share/code-server/extensions"

@Merith-TK
Copy link
Contributor Author

alright, so it was me not knowing how to use docker properly, thanks for the information!

So if i wanted the docker container to hold the same config/extensions as the binary setup, the command would be something like this?

docker run -it -p 127.0.0.1:8443:8443 -v "/opt/code-server/workspace:/home/coder/project" -v "/opt/code-server/extensions:/home/code/extensions" -v /opt/code-server/data:/home/coder/data" codercom/code-server -e /home/coder/extensions -d /home/coder/data --allow-http --no-auth

@deansheather
Copy link
Member

Yeah, that should work if you add the missing double quote.

@Merith-TK
Copy link
Contributor Author

Okay, now im getting the samegrey screen error as my last issue (websockets are open)

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 23, 2019

@deansheather using the docker method we just described, all I am getting is a grey screen

Websockets are open on my web server so I know that's not the issue, I think

image

#edit
logs are on the way

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 23, 2019

merith-admin@merith-tk:~$ sudo docker run -it -p 127.0.0.1:8443:8443 -v "/opt/code-server/workspace:/home/coder/project" -v "/opt/code-server/extensions:/home/code/extensions" -v "/opt/code-server/workspace:/home/coder/project" -v "/opt/code-server/extensions:/home/code/extensions" -v "/opt/code-server/data:/home/coder/data" --allow-http --no-auth codercom/code-server -e /home/coder/extensions -d /home/coder/data --allow-http --no-auth
[sudo] password for merith-admin:
(node:6) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability
issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
INFO  code-server development
INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/home/coder/data","extensions-dir":"/home/coder/extensions","working-dir":"/home/coder/project","log-dir":"/home/coder/.cache/code-server/logs/20190523035516671"}
INFO  Starting webserver... {"host":"0.0.0.0","port":8443}
WARN  No certificate specified. This could be insecure.
WARN  Documentation on securing your setup: https://github.com/codercom/code-server/blob/master/doc/security/ssl.md
WARN  Launched without authentication.
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO
INFO  Starting shared process [1/5]...
WARN  stderr {"data":"(node:18) [DEP0005] DeprecationWarning: Buffer() is deprecated due to
security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\n"}
INFO  Connected to shared process
Error: ENOENT: no such file or directory, open '/src/packages/server/build/web/favicon.ico'
INFO  WebSocket opened / {"client":1,"ip":"172.17.0.1"}

@deansheather
Copy link
Member

Not sure what the cause of the grey screen is, could you check if there's anything in the browser console?

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 27, 2019 via email

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 28, 2019

And i jsut realized what you meant

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 28, 2019

For some stupid reason, it wants to work now... WELP!
__

UPDATE

Realized this was before i specifed data and extension dirs

@Merith-TK
Copy link
Contributor Author

Merith-TK commented May 28, 2019

How i test this is by uninstalling docker, and then reinstalling it with absolutely nothing persistant

WORKING Code-Server (binary)

https://i.imgur.com/q4u8ZkF.png

DOCKER (UNSPECIFIED/DEFAULT RUN COMMAND)

https://pastebin.com/D5iUh6DJ

DOCKER (Specified)

https://pastebin.com/Fw1SL7di

@palp
Copy link

palp commented Jun 2, 2019

I was able to get this working by copying the entire /home/coder/.local/share/code-server directory from a working container using docker cp, then changing the owner on that to 1000:1000 (the uid used inside the coder container) and mounting that. I haven't tested to see if you can mount individual folders with the correct permissions - this works well enough for me.

@sr229
Copy link
Contributor

sr229 commented Nov 7, 2019

Requesting further information. Failure to reply means it was fixed in your end and I'll close this automatically after 3 days.

@Merith-TK
Copy link
Contributor Author

I actually gave up with docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants