docker / docker/metadata-action
Generating tags for multiple bake targets
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 160
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 12
Description
Description
Let's say I have the following docker-bake.hcl:
group "default" {
targets = ["foo", "bar"]
}
target "foo" {
dockerfile = "Dockerfile.foo"
tags = ["my/foo:latest"]
}
target "bar" {
dockerfile = "Dockerfile.bar"
tags = ["my/bar:latest"]
}
The tags listed above function a bit like defaults, i.e., they're used when I run bake locally for testing. On GitHub Actions, however, I'd like to use docker/metadata-action to generate a list of tags based on various criteria (semver, date, etc...). These generated tags should replace the :latest tag from docker-bake.hcl, but I still want to keep the base name of the two images (my/foo and my/bar).
This would be trivial to accomplish with a single target (using the images input), but I didn't find a way to do it for multiple targets, where each target has a distinct image name.
Apologies if I missed something obvious (seems odd that this use case isn't already supported, since the whole point of bake is orchestrating the build of multiple targets).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the action's documented images input and its GitHub Actions integration with Docker Bake. Confirm how metadata-generated tags should replace :latest while preserving the distinct my/foo and my/bar base names, then add coverage for a group containing multiple targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, github-actions, typescript
- Domain
- build-system, ci-cd, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100