docker: attach to container before starting
This commit is contained in:
parent
de04e73e82
commit
136540111d
|
@ -111,14 +111,17 @@ func (e *Environment) Start(ctx context.Context) error {
|
||||||
actx, cancel := context.WithTimeout(ctx, time.Second*30)
|
actx, cancel := context.WithTimeout(ctx, time.Second*30)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
if err := e.Attach(actx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if err := e.client.ContainerStart(actx, e.Id, types.ContainerStartOptions{}); err != nil {
|
if err := e.client.ContainerStart(actx, e.Id, types.ContainerStartOptions{}); err != nil {
|
||||||
return errors.WrapIf(err, "environment/docker: failed to start container")
|
return errors.WrapIf(err, "environment/docker: failed to start container")
|
||||||
}
|
}
|
||||||
|
|
||||||
// No errors, good to continue through.
|
// No errors, good to continue through.
|
||||||
sawError = false
|
sawError = false
|
||||||
|
return nil
|
||||||
return e.Attach(actx)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop stops the container that the server is running in. This will allow up to
|
// Stop stops the container that the server is running in. This will allow up to
|
||||||
|
|
Loading…
Reference in New Issue
Block a user