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

Fig port command #402

Merged
merged 1 commit into from
Sep 5, 2014
Merged

Fig port command #402

merged 1 commit into from
Sep 5, 2014

Conversation

dnephin
Copy link

@dnephin dnephin commented Aug 12, 2014

This branch adds a new fig command, which returns the local port binding of a service.

It's used when you want to run a test suite (or something else) outside of a docker image, so you can connect to one of your containers easily.

I will be using it mostly programatically, but I thought I'd add a command at the same time.

@bfirsh
Copy link

bfirsh commented Aug 12, 2014

Cool! Thanks Daniel!

Perhaps this could be called "fig port"? It seems to behave like the "docker port" command.

@dnephin
Copy link
Author

dnephin commented Aug 12, 2014

Oh, so it is! Sure, fig port sounds appropriate

@dnephin
Copy link
Author

dnephin commented Aug 14, 2014

Changed to fig port, and added an integration test

@dnephin dnephin changed the title Fig local_port Fig port command Aug 14, 2014
@howitzers
Copy link

Suggestion: output HostIp as well. Docker port already does that, and it's really useful for multihost deployments.

And to boot, fig ps should probably output the HostIp as well to keep consistency.

@aanand
Copy link

aanand commented Aug 14, 2014

+1 on including the hostname in both fig port and fig ps, since the docker equivalents do the same.

aanand referenced this pull request in dnephin/compose Aug 14, 2014
…ice.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
Copy link
Author

dnephin commented Aug 15, 2014

Include hostname in port and ps

@bfirsh
Copy link

bfirsh commented Aug 18, 2014

Looking good. Any chance we could add fig port to this list here? https://github.com/docker/fig/blob/df7c2cc43f0009a5afc7106b9b5ce23a2806a682/fig/cli/main.py#L82-L93

@dnephin
Copy link
Author

dnephin commented Aug 18, 2014

Oh right, I forgot the docs. Added to the usage text and cli.md

@prologic
Copy link

+1

@bfirsh
Copy link

bfirsh commented Sep 4, 2014

LGTM

"""
for container in self.client.containers():
if not self.has_container(container):
continue
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we're not just using self.containers() here, instead of manually filtering?

@aanand
Copy link

aanand commented Sep 4, 2014

LGTM

…ice.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
Copy link
Author

dnephin commented Sep 5, 2014

rebased to resolve merge conflicts

aanand added a commit that referenced this pull request Sep 5, 2014
@aanand aanand merged commit 8d3c9dc into docker:master Sep 5, 2014
@dnephin dnephin deleted the fig_ports.rebase branch September 10, 2014 02:42
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Fig port command
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
xulike666 pushed a commit to xulike666/compose that referenced this pull request Jan 19, 2017
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.

5 participants