| 331 | } |
| 332 | |
| 333 | func (cr *containerReference) remove() common.Executor { |
| 334 | return func(ctx context.Context) error { |
| 335 | if cr.id == "" { |
| 336 | return nil |
| 337 | } |
| 338 | |
| 339 | logger := common.Logger(ctx) |
| 340 | _, err := cr.cli.ContainerRemove(ctx, cr.id, client.ContainerRemoveOptions{ |
| 341 | RemoveVolumes: true, |
| 342 | Force: true, |
| 343 | }) |
| 344 | if err != nil { |
| 345 | logger.Error(fmt.Errorf("failed to remove container: %w", err)) |
| 346 | } |
| 347 | |
| 348 | logger.Debugf("Removed container: %v", cr.id) |
| 349 | cr.id = "" |
| 350 | return nil |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | func (cr *containerReference) mergeContainerConfigs(ctx context.Context, config *container.Config, hostConfig *container.HostConfig) (*container.Config, *container.HostConfig, error) { |
| 355 | logger := common.Logger(ctx) |