[Bug]: code-server (run with docker) will always overwrite PATH variable
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Remote OS: Ubunu
- Remote Architecture: amd64
code-server --version
: both v4.7.0 and v4.0.1 are tried
Steps to Reproduce
- In a machine with docker installed, run
mkdir -p ~/.config docker run -it --name code-server -p 127.0.0.1:8080:8080 \ -v "$HOME/.config:/home/coder/.config" \ -v "$PWD:/home/coder/project" \ -u "$(id -u):$(id -g)" \ -e "DOCKER_USER=$USER" -e "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/some/path" \ codercom/code-server:latest
- Login to the browser, launch terminal in vscode and print the PATH
echo $PATH
- Always get:
Expected
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/some/path
with some extra paths appended by code-server.
Actual
/usr/lib/code-server/lib/vscode/bin/remote-cli:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Logs
No response
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
- I cannot reproduce this in VS Code.
- I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- I am using HTTPS.
Notes
Though I checked I am using HTTPS, but I actually running locally without HTTPS. I checked it because it is a must and I think HTTPS has nothing to do with the issue.
Issue Analytics
- State:
- Created a year ago
- Comments:23 (18 by maintainers)
Top Results From Across the Web
Docker Tools Tips and Tricks - Visual Studio Code
DOCKER_HOST attribute will override your Docker context and the DOCKER_HOST environment variable will override both the docker.environment.DOCKER_HOST attribute ...
Read more >FAQ - code-server v4.8.0 docs - Coder
Frequently asked questions on installing and running code-server. ... If you set the XDG_DATA_HOME environment variable, the data directory will be ...
Read more >Code Server Installed on Docker - YouTube
In this video we' ll take a look at a Docker container that has been requested multiple times in my comments section: Code-Server....
Read more >How to set an environment variable in a running docker ...
There are generaly two options, because docker doesn't support this feature now: Create your own script, which will act like runner for your ......
Read more >How To Set Up the code-server Cloud IDE Platform on Ubuntu ...
This means that you can use various devices running different operating systems, and always have a consistent development environment on hand.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried the same thing with
debian:11
(this is what code-server is based on) and reproduced:In
/etc/profile
there is this:So this could be the cause of the problem.
No. But see https://github.com/b-data/jupyterlab-python-docker-stack#run-container
Adapted to your example:
ℹ️ Run the command in an empty directory so that the container populates it.
👉
-e CHOWN_HOME=1
and-e CHOWN_HOME_OPTS=-R
is only required at first run.