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

Add container name to hosts entry when using syntax --network container:name #6678

Closed
skorhone opened this issue Jun 18, 2020 · 1 comment · Fixed by #6683
Closed

Add container name to hosts entry when using syntax --network container:name #6678

skorhone opened this issue Jun 18, 2020 · 1 comment · Fixed by #6683
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@skorhone
Copy link

/kind feature

Description
When referencing another container with podman run --network container:name, podman creates a host entry that contains referenced containers ip and id.

This requires user to do an additional step of resolving container id when running ad-hoc commands

podman run -it --network container:sonar_mysql -v ./sonar-dump.gz:/sonar-dump.gz --rm mysql:5.7 mysql -h<would be awesome, if I could use sonar_mysql here>

Describe the results you received:
Hosts file has target container ip and id

Describe the results you expected:
Hosts file has target container ip, id and name

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 18, 2020
@rhatdan
Copy link
Member

rhatdan commented Jun 19, 2020

The traditional way to handle this is to set the hostname. in the first container. Then you can reference it in the second container. I have a simple patch to do what you want, but I am worried about why this was not done before. I will open the PR to get comment and see if someone knows why this was not done in the past.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants