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

feat(container): Add more ways of finding container name when in docker. #5958

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zshoham
Copy link

@Zshoham Zshoham commented May 4, 2024

Description

When using distrobox with docker and starship I noticed that the container name is not displayed, instead only "Docker".

This adds tow checks to find the actual container name:

  • Docker usually sets the HOSTNAME variable to the container name.
  • Distrobox sets the CONTAINER_ID variable to the container name.

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

Two checks were added:
* Docker usually sets the HOSTNAME variable to the container name.
* Distrobox sets the CONTAINER_ID variable to the container name.
@Zshoham Zshoham force-pushed the find_containerid_in_docker branch from 23fb36b to e8c5199 Compare May 4, 2024 12:54
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

Successfully merging this pull request may close these issues.

None yet

1 participant