Handle multiple prefixes with Bake
See original GitHub issueLet’s say I have a Dockerfile like so:
FROM debian:latest AS debian
[...]
# debian is the default
FROM debian
FROM ubuntu:latest AS ubuntu
[...]
FROM alpine:latest AS alpine
[...]
And a docker-bake.hcl
like so:
group "default" {
targets = ["debian"]
}
group "all" {
targets = ["debian", "ubuntu", "alpine", "centos"]
}
target "base" {
context = "."
}
target "debian" {
inherits = ["base"]
target = "debian"
}
target "ubuntu" {
inherits = ["base"]
target = "ubuntu"
}
target "alpine" {
inherits = ["base"]
target = "alpine"
}
Any suggestions on how could I integrate the Metadata Action with the Bake Action so I would have tags generated with prefixes like:
my-image:latest # debian
my-image:debian
my-image:ubuntu
my-image:alpine
And of course, tagging with semver like my-image:alpine-1.1.0
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
CakePHP Bake from different templates when using prefix
I want to different versions of all these templates when I bake with the admin prefix. I tried creating a Bake Theme.
Read more >Routing - 4.x - CakePHP Cookbook
Multi word prefixes are by default converted using dasherize inflection, ie MyPrefix would be mapped to my-prefix in the URL. Make sure to...
Read more >Can an English word have more than one prefix? - Quora
Yes. The English word formed can take different single prefixes to create such words as deformed, reformed ...
Read more >Prefix-Suffix-Root List by Grade Level
(Generally, prefixes and suffixes change the meanings of roots, ... plural, more than one hats, pigs, boxes, wishes. Anglo-Saxon. -ing action/ process.
Read more >The Toolbag Baking Tutorial - Marmoset
Toolbag's powerful GPU rendering engine is capable of handling very ... The Ignore Groups option will cast AO between different bake groups.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this exact problem, and figured that the bake files are just JSON files that can be merged with
jq
. This is how I solved it, by running the action twice and merging the files:https://github.com/matrix-org/matrix-authentication-service/blob/1df5cf42e32abaeedddc504afeb431d77154f78f/.github/workflows/check.yaml#L317-L345
That way I have two different targets filled in my bake file: https://github.com/matrix-org/matrix-authentication-service/blob/1df5cf42e32abaeedddc504afeb431d77154f78f/docker-bake.hcl#L4-L6
I’m trying to do something similar to this. I have a repo with multiple micro-services, each service is pushed to a registry (
ghcr.io/<owner>/<project>/<service>:<tag>
) and it doesn’t seem possible to use this metadata data action to set the tags for each service at the moment. I could do it with multiple steps however that would slow down the build as they’d have to run sequentially.