Stop all containers before starting builds

Description

To avoid failures such as this one:

[INFO] DOCKER> [elasticsearch:7.10.1] "elasticsearch": Start container b3d8d022e7a2 [ERROR] DOCKER> Error occurred during container startup, shutting down... [ERROR] DOCKER> I/O Error [Unable to start container id [b3d8d022e7a2] : {"message":"driver failed programming external connectivity on endpoint elasticsearch-2 (61c0a69bb8cc5d036c4f2258ccd4ebdcb3a7ac1aafec48f31a7c617224da3e69): Bind for 0.0.0.0:9200 failed: port is already allocated"} (Internal Server Error: 500)]

I suspect it's caused by failing (or cancelled) builds that don't stop containers correctly. So, let's stop all containers before each build, and in a finally clause after each build.

Activity

Show:
Fixed

Details

Assignee

Reporter

Sprint

Priority

Created December 3, 2021 at 8:36 AM
Updated December 3, 2021 at 1:10 PM
Resolved December 3, 2021 at 8:46 AM

Flag notifications