Skip to content
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

In development containers, environment variables are inherited from the base image, with the exception of PATH. #228

Open
david9991 opened this issue May 23, 2023 · 4 comments

Comments

@david9991
Copy link
Contributor

Description of the Issue
In the development container, environment variables inherit from the base image by default, except the PATH variable which is overridden by Okteto.

Steps to Reproduce
Dockerfile:

FROM --platform=linux/amd64 rust as dev

RUN rustup target add aarch64-unknown-linux-gnu
RUN rustup toolchain install stable-aarch64-unknown-linux-gnu

okteto.yml:

namespace: okteto
build:
  testrust:
    dockerfile: Dockerfile
    image: xxx/testrust
    target: dev
dev:
  testrust:
    sync:
      - .:/usr/src/app
    image: ${OKTETO_BUILD_TESTRUST_IMAGE}
    autocreate: true

After building and running with Okteto, executing rustup for cargo in the development container was not possible because Okteto had overridden the PATH set in the rust base image.

Expected behavior
The specified PATH in the development container built by Okteto should be appended to the end of the PATH from the base image, instead of overriding it.

Desktop (please complete the following information):

  • OS: macOS
  • Version: 13.4

Additional context

@david9991
Copy link
Contributor Author

It seems that the PATH is being overridden by either the Okteto VSCode extension (Remote-Kubernetes) or the code-server. There are no issues with the standalone Okteto environment.

@pchico83 pchico83 transferred this issue from okteto/okteto May 23, 2023
@pchico83
Copy link
Contributor

It seems that the PATH is being overridden by either the Okteto VSCode extension (Remote-Kubernetes) or the code-server. There are no issues with the standalone Okteto environment.

@david9991 based on it, I transferred the issue to this repo https://github.com/okteto/remote-kubernetes

@rberrelleza
Copy link
Member

@david9991 what is the value of $PATH that you are seeing? I used your repro and this is what I'm seeing from within the container:

# echo $PATH
/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.69.0 (84c898d65 2023-04-16)`
# 

@david9991
Copy link
Contributor Author

Sorry for the delayed response. In the integrated terminal of the remote window, the PATH variable is being overridden. Here is my $PATH variable:

Screenshot 2023-05-26 at 12 45 15

Here is the one in the local window, which is OK.

Screenshot 2023-05-26 at 12 53 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants