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
Container module incorrectly shows "Systemd" in ubuntu:20.04 Docker container #3821
Comments
I would like to work on this issue |
The Apparently, the safest way to determine if a process is running inside Docker or not is |
This also happens when running under podman, and also for Ubuntu 22.04. |
Actually, according to the description of the module the variable $name should contain the container name, not the container engine. |
on WSL(v2) now when SystemD is natively supported and enabled, container always show |
* Fixes #3821 to provide an improved experience for display of container Details: - podman containerenv processing is now happens before systemd - if systemd/container contains "docker", now shows "Docker" - maintains fix from #4593 to prevent 'Systemd" display on WSL - refactors tests for systemd detection * only compile function for linux * correct 'default' systemd test use use None, codecov caught this mistake * refactor my change to systemd/container detection so that it has one stage instead of multiple
…#4832) * Fixes starship#3821 to provide an improved experience for display of container Details: - podman containerenv processing is now happens before systemd - if systemd/container contains "docker", now shows "Docker" - maintains fix from starship#4593 to prevent 'Systemd" display on WSL - refactors tests for systemd detection * only compile function for linux * correct 'default' systemd test use use None, codecov caught this mistake * refactor my change to systemd/container detection so that it has one stage instead of multiple
Current Behavior
The container module shows "Systemd" instead of "Docker" if inside a container created from the ubuntu:20.04 Docker image.
Expected Behavior
It should show "Docker" if inside a Docker container.
Additional context/Screenshots
The container module checks if the path
/run/systemd/container
exists to determine if it is a Systemd container. For some reason the above mentioned path exists in the mentioned image.Possible Solution
A relatively simple fix would be to move the check for "Docker" before the one for "Systemd". Currently the Docker check comes after the Systemd check.
Environment
Relevant Shell Configuration
Starship Configuration
The text was updated successfully, but these errors were encountered: