profile
viewpoint

Ask questionsEnforce user permissions for user data and extension dirs on container startup

Description

When we start code-server as a docker container and mounting a path for extensions we need to make sure on startup that it belongs to the same user as the code-server

Steps to Reproduce

use the oneliner from README.md

Result

docker run -it -p 127.0.0.1:8080:8080 -v "${HOME}/.local/share/code-server:/home/coder/.local/share/code-server" -v "$PWD:/home/coder/project" codercom/code-server
(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.
ERROR { [Error: EACCES: permission denied, mkdir '/home/coder/.local/share/code-server/extensions']
  [stack]:
   'Error: EACCES: permission denied, mkdir \'/home/coder/.local/share/code-server/extensions\'',
  [message]:
   'EACCES: permission denied, mkdir \'/home/coder/.local/share/code-server/extensions\'',
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/coder/.local/share/code-server/extensions' }

cdr/code-server

Answer questions frank-dspeed

@sr229 but this issue is about the extensions dir i think there the discussion is less relevant as it is always clear that extensions need to be readwrite by code-server user it self its not about the project files

useful!
source:https://uonfu.com/
answerer
Frank Lemanschik frank-dspeed @direktspeed Europe https://dspeed.eu I Love Building Things to Build and Run Things Faster :)
Github User Rank List