brigadecore / brigadecore/brigade

CI/CD: Wait for Docker port to be open

Open
#1,932 6 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
Go
Stars
2.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

Our CI/CD processes (see `.brigade/brigade.ts`) build multi-arch Docker images using "Docker in Docker." The primary container for each job runs the Docker client while the Docker server runs in a sidecar.

Currently, the image build processes use a `sleep` before proceeding with a `docker buildx ...` This allows the sidecar a grace period to start before the build proceeds. Often this delays builds longer than necessary. Sometimes it leads to failures because resource demand in the cluster meant the Docker server in the sidecar was slow to start.

This issue suggests modifying the process to wait only as long as needed (up to some limit -- 90 seconds maybe) for port 2375 to actually start accepting requests.

Some very small amount of research will be required on how best to achieve, this, but it _is_ easily accomplished with `nc` or even pure bash.

Note: Several other repos in the @brigadecore org would benefit from a similar change.

Contributor guide

Open the contributing guide

Research direction

Start in .brigade/brigade.ts by locating the sleep before the docker buildx commands and review how the Docker sidecar is addressed. Research a port check with nc or pure bash for port 2375, including the suggested 90-second limit. Done means builds proceed when the port accepts requests without an unnecessarily long fixed delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, docker, typescript
Domain
ci-cd, devops, infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.