question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PATH environment variable overwritten in version 4.0.1 using Docker image

See original GitHub issue

OS/Web Information

  • Web Browser: Firefox 95.0.1
  • Local OS: Ubuntu 20.04
  • Remote OS:
  • Remote Architecture:
  • code-server --version: 4.0.1

Steps to Reproduce

The problem can be reproduced by building the following minimal Docker image :

FROM codercom/code-server:4.0.1
ENV PATH="/home/coder/local/bin/conda/bin:${PATH}"
RUN echo $PATH

and running it as a local server in the browser as explained in the installation guide.

Expected

When opening a terminal in VSCode, the value of $PATH should be the same as the one echoed at the end of the docker build step. The behavior is correct when building the image from code-server:3.12.0.

Actual

When building from code-server:4.0.1, the $PATH variable gets overwritten with the following path /usr/lib/code-server/vendor/modules/code-oss-dev/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games. If I run an interactive shell in the docker image using docker exec, the $PATH is as expected. But when opening VSCode in the browser, it is incorrect. I don’t see any command in the entrypoint.sh script which modifies this variable.

Thank’s for this great software.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
avouacrcommented, Feb 24, 2022

@rafipiccolo

our workaround for the time being :

ENV PATH=xxxx
RUN echo "export PATH=$PATH" >> /home/coder/.bashrc 

which sets the correct $PATH provided $SHELL is set to /bin/bash, which it is by default.

2reactions
code-ashercommented, Jan 10, 2022

I took a short look but nothing stood out in particular. We will need to dig in a bit more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker image env variables overwritten by local machine
The output of running echo $PATH against the created image is returning my local machines $PATH variable. What? The primary thing I'm trying...
Read more >
Environment variables in Compose | Docker Documentation
You can override the environment file path using a command line argument --env-file . Using the “--env-file” option . By passing the...
Read more >
Environment variables in Compose | Docker Documentation
It's possible to use environment variables in your shell to populate values inside a Compose file: web: image: "webapp:${TAG}".
Read more >
Environment variable reference for LSF BSUB_BLOCK ... - IBM
Reference for LSF environment variables. ... Docker image affinity interacts with host preference and order[] string requests in the following manner:.
Read more >
Upgrade Notes | TeamCity On-Premises Documentation
Updates in TeamCity Agent Docker images for Linux: ... If you are using these environment variables in your build scripts, we encourage you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found