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

Helper function for adding ports #12

Open
lucymhdavies opened this issue Jan 26, 2018 · 0 comments
Open

Helper function for adding ports #12

lucymhdavies opened this issue Jan 26, 2018 · 0 comments

Comments

@lucymhdavies
Copy link

lucymhdavies commented Jan 26, 2018

As per https://github.com/staticli/staticli/issues/2

It is already possible for a (container) cali task to expose ports, but it's kinda awkward to add it:

import "github.com/docker/go-connections/nat"
    task.HostConf.PortBindings = nat.PortMap{
        nat.Port("4000/tcp"): []nat.PortBinding{
            {HostIP: "0.0.0.0", HostPort: "1337"},
        },
    }

Consider a helper function for this, e.g. task.AddPort / task.AddPorts

Consider also having said helper function optionally define flags.

Consider having it such that, if a user specified port is not available, it will pick one at random, or just refuse to start (depending on user/developer preference?)

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

No branches or pull requests

1 participant