Skip to content

Instantly share code, notes, and snippets.

@wheresalice
Created January 24, 2018 19:58
Show Gist options
  • Save wheresalice/6c6243c3c9c7a71ca1903bef1f2693f1 to your computer and use it in GitHub Desktop.
Save wheresalice/6c6243c3c9c7a71ca1903bef1f2693f1 to your computer and use it in GitHub Desktop.
diff --git a/cmd/rake.go b/cmd/rake.go
index fcaca52..6b7d80f 100644
--- a/cmd/rake.go
+++ b/cmd/rake.go
@@ -1,6 +1,8 @@
package cmd
import "github.com/skybet/cali"
+import "github.com/docker/go-connections/nat"
+import _ "github.com/pkg/errors"
func init() {
@@ -16,7 +18,10 @@ Examples:
command.BindFlags()
task := command.Task("kaerast/rake-preview")
- task.HostConf.PublishAllPorts = true
- // @todo the above publishes ports defined in the Dockerfile as `EXPOSE` on a random port. We would prefer a defined port, however we don't understand enough Go to use task.HostConf.PortBindings
+ task.HostConf.PortBindings = nat.PortMap{
+ nat.Port("4000/tcp"): []nat.PortBinding{
+ {HostIP: "0.0.0.0", HostPort: "4000"},
+ },
+ }
task.SetInitFunc(func(t *cali.Task, args []string) {})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment