| 186 | } |
| 187 | |
| 188 | func (w *ttyWriter) On(events ...api.Resource) { |
| 189 | w.mtx.Lock() |
| 190 | defer w.mtx.Unlock() |
| 191 | for _, e := range events { |
| 192 | if e.ID == "Compose" { |
| 193 | _, _ = fmt.Fprintln(w.info, ErrorColor(e.Details)) |
| 194 | continue |
| 195 | } |
| 196 | |
| 197 | if w.operation != "start" && (e.Text == api.StatusStarted || e.Text == api.StatusStarting) && !w.detached { |
| 198 | // skip those events to avoid mix with container logs |
| 199 | continue |
| 200 | } |
| 201 | w.event(e) |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func (w *ttyWriter) event(e api.Resource) { |
| 206 | // Suspend print while a build is in progress, to avoid collision with buildkit Display |