Skip to content

Commit

Permalink
Faster failure on startup if container fails, fixes #1135 (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Oct 1, 2018
1 parent a399558 commit 66a6eae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ddevapp/ddevapp.go
Expand Up @@ -808,7 +808,7 @@ func (app *DdevApp) Wait(containerTypes ...string) error {
}
err := dockerutil.ContainerWait(containerWaitTimeout, labels)
if err != nil {
return fmt.Errorf("%s service %v", containerType, err)
return fmt.Errorf("%s container failed: %v", containerType, err)
}
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/dockerutil/dockerutils.go
Expand Up @@ -152,8 +152,12 @@ func ContainerWait(waittime time.Duration, labels map[string]string) error {
}
status = GetContainerHealth(container)

if status == "healthy" {
switch status {
case "healthy":
return nil
case "exited":
service := container.Labels["com.docker.compose.service"]
return fmt.Errorf("container start failed, please use 'ddev logs -s %s` to find out why it failed", service)
}
}
}
Expand Down

0 comments on commit 66a6eae

Please sign in to comment.