Vendor integration dependencies.
This commit is contained in:
parent
dd5e3fba01
commit
55b57c736b
2451 changed files with 731611 additions and 0 deletions
28
integration/vendor/github.com/libkermit/docker/start.go
generated
vendored
Normal file
28
integration/vendor/github.com/libkermit/docker/start.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
package docker
|
||||
|
||||
import (
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/docker/engine-api/types"
|
||||
)
|
||||
|
||||
// Start lets you create and start a container with the specified image, and
|
||||
// default configuration.
|
||||
func (p *Project) Start(image string) (types.ContainerJSON, error) {
|
||||
return p.StartWithConfig(image, ContainerConfig{})
|
||||
}
|
||||
|
||||
// StartWithConfig lets you create and start a container with the specified
|
||||
// image, and some custom simple configuration.
|
||||
func (p *Project) StartWithConfig(image string, containerConfig ContainerConfig) (types.ContainerJSON, error) {
|
||||
container, err := p.CreateWithConfig(image, containerConfig)
|
||||
if err != nil {
|
||||
return types.ContainerJSON{}, err
|
||||
}
|
||||
|
||||
if err := p.Client.ContainerStart(context.Background(), container.ID, types.ContainerStartOptions{}); err != nil {
|
||||
return container, err
|
||||
}
|
||||
|
||||
return p.Inspect(container.ID)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue