jenkinsci / jenkinsci/docker-ssh-agent

Multiarch parallel stage should only build the branch target and not all `linux` ones

Open Beginner friendly
#691 2 comments 0 reactions 0 assignees View on GitHub
linux
Dominant language
PowerShell
Stars
208
Forks
177
Avg merge
1d 17h
Merged PRs (30d)
11

Description

### Jenkins and plugins versions report

ci.jenkins.io

### What Operating System are you using (both controller, and any agents involved in the problem)?

N/A

### Reproduction steps

1. Start a CI build
2. Notice that multiarch parallel stages are building all images and not only their targets:
https://github.com/jenkinsci/docker-ssh-agent/blob/aa27173946e2af5af58a45b08bec167fd79ca29d/Jenkinsfile#L109-L114
https://github.com/jenkinsci/docker-ssh-agent/blob/aa27173946e2af5af58a45b08bec167fd79ca29d/Makefile#L62-L63
```bash
$ docker buildx bake --file docker-bake.hcl --file docker-bake.override.json linux --print \
| jq -r '.target | keys'
[+] Building 0.0s (1/1) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading docker-bake.hcl 6.51kB / 6.51kB 0.0s
=> => reading docker-bake.override.json 450B / 450B 0.0s
[
"alpine_21",
"alpine_25",
"debian_21",
"debian_25"
]
```

### Expected Results

The stage build all archs of the branch target only.

### Actual Results

All branches are rebuilding all `linux` targets in multiarch, builds which take from 15 to 30 minutes on current agents.

### Anything else?

Introduced in https://github.com/jenkinsci/docker-ssh-agent/pull/502, which didn't had the complementary https://github.com/jenkinsci/docker-agents/pull/1159 (introducing proper `multiarch`) at that time

### Are you interested in contributing a fix?

Yes, incoming

Contributor guide

Open the contributing guide

Research direction

Start with the multiarch stage references in Jenkinsfile lines 109-114 and the related target selection in Makefile lines 62-63. Run the reported docker buildx bake command and inspect docker-bake.hcl and docker-bake.override.json to understand the branch targets. Done means each branch's multiarch stage builds only all architectures for its own target, rather than every linux target.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.