-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Bug]: code-server (run with docker) will always overwrite PATH variable #5621
Comments
Prepending Cross references: |
Prepending is not the issue. My issue is that PATH has been overwritten instead of prepending. |
@code-asher do you mind taking a look at this one? |
@huweiATgithub What |
I am running from the docker:
therefore, it should not matter what is my path in |
Let alone that I deploy code-server with docker. I have also tried that on multiple machines. So I suppose that is not an issue related to the host machines. You may quickly execute the above docker command to see if that can be reproduced. |
BTW, if you tried to I guess before the code-server launch, it has a wrapper that modifies the PATH variable to insure code-server's launching env. The wrapper is not respecting the PATH from its env. |
I can reproduce your issue. |
I can confirm that.
I am setting |
I remember looking into this briefly before (#4699) but I have no idea where it happens. 😞 |
b-data looks very fancy! integrating jupyterlab with vscode is really cool and productive.
then build it and run it with Docker using a command similar to the one posted above. |
How did I not find out the previous issue 😲 I searched that... |
Oh wait I think I might know what it is! I think VS Code spawns a login shell to get There are some terminal settings like |
Can confirm that disabling |
can it preserve the modified PATH? |
No. But see https://github.com/b-data/jupyterlab-python-docker-stack#run-container Adapted to your example: docker run -it --name jupyter-code-server \
-u root \
-p 8888:8888 \
-v $PWD:/home/$USER \
-e NB_USER=$USER \
-e NB_UID=$(id -u) \
-e NB_GID=$(id -g) \
-e CHOWN_HOME=1 \
-e CHOWN_HOME_OPTS=-R \
-e PATH=/opt/TinyTeX/bin/linux:/opt/quarto/bin:/opt/code-server/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/some/path \
registry.gitlab.b-data.ch/jupyterlab/python/scipy ℹ️ Run the command in an empty directory so that the container populates it. |
Yeah it looks ilke the "inherit env" name is misleading. It seems to mean that it spawns a login shell to get the environment rather than using the current environment (which sounds backwards from "inherit" to me 🤷 but I guess that is the name they went with). So to summarize:
|
I checked the .bashrc and .profile. There is nothing particular done there. |
I tried the same thing with
In
So this could be the cause of the problem. |
What about adding a release for ubuntu:focal? It also benefits those users who use ubuntu:focal more. |
That seems chill. Maybe we can do the Docker tags like this:
I patterned that after the Python image but maybe in code-server's case it makes more sense to do it by OS.
We could also do both. |
Looks good. These are fine if documented I think. |
Is there an existing issue for this?
OS/Web Information
code-server --version
: both v4.7.0 and v4.0.1 are triedSteps to Reproduce
echo $PATH
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?
Are you accessing code-server over 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.
The text was updated successfully, but these errors were encountered: