1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

Sync with libcompose

This commit is contained in:
Josh Curl
2016-05-23 17:21:28 -07:00
parent 448f12acb1
commit 42e48476e7
17 changed files with 278 additions and 182 deletions

View File

@@ -11,8 +11,10 @@ import (
"syscall"
"time"
"golang.org/x/net/context"
log "github.com/Sirupsen/logrus"
"github.com/docker/libcompose/docker"
composeClient "github.com/docker/libcompose/docker/client"
"github.com/docker/libcompose/project"
"github.com/rancher/os/cmd/control"
"github.com/rancher/os/compose"
@@ -166,7 +168,7 @@ func getPid(service string, project *project.Project) (int, error) {
return 0, err
}
containers, err := s.Containers()
containers, err := s.Containers(context.Background())
if err != nil {
return 0, err
}
@@ -175,7 +177,7 @@ func getPid(service string, project *project.Project) (int, error) {
return 0, nil
}
client, err := docker.CreateClient(docker.ClientOpts{
client, err := composeClient.Create(composeClient.Options{
Host: config.DOCKER_SYSTEM_HOST,
})
if err != nil {
@@ -187,8 +189,8 @@ func getPid(service string, project *project.Project) (int, error) {
return 0, err
}
info, err := client.InspectContainer(id)
if err != nil || info == nil {
info, err := client.ContainerInspect(context.Background(), id)
if err != nil || info.ID == "" {
return 0, err
}