b7daa2f3a4
Update traefik dependencies (docker/docker and related) - Update dependencies - Fix compilation problems - Remove vdemeester/docker-events (in docker api now) - Remove `integration/vendor` - Use `testImport` - update some deps. - regenerate the lock from scratch (after a `glide cc`)
28 lines
855 B
Go
28 lines
855 B
Go
package docker
|
|
|
|
import (
|
|
"golang.org/x/net/context"
|
|
|
|
"github.com/docker/docker/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)
|
|
}
|