Move Weave docker plugin into this repo

This commit is contained in:
Bryan Boreham committed 2015-11-26 14:40:28 +00:00
1 parent 13042002d7
commit 350b8efb0b
10 files changed
+741 -5

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package plugin
import (
"github.com/fsouza/go-dockerclient"
. "github.com/weaveworks/weave/common"
)
type dockerer struct {
client *docker.Client
}
func (d *dockerer) getContainerBridgeIP(nameOrID string) (string, error) {
Log.Debugf("Getting IP for container %s", nameOrID)
info, err := d.InspectContainer(nameOrID)
if err != nil {
return "", err
}
return info.NetworkSettings.IPAddress, nil
}
func (d *dockerer) InspectContainer(nameOrId string) (*docker.Container, error) {
return d.client.InspectContainer(nameOrId)
}