-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list-targets subaction #174
Conversation
6f47acd
to
c9eb1bb
Compare
804e69f
to
1d468bc
Compare
What's the difference of just setting the matrix value to I think eventually we would want to do something that would auto-split based on platform for example and then merge the subimages built from matrix together into a single image. In that case, the current limited action could be confusing, or maybe it should be named differently to make the distinction clear. |
This {
"group": {
"default": {
"targets": [
"validate"
]
},
"lint": {
"targets": [
"lint-default",
"lint-labs",
"lint-nydus",
"lint-yaml",
"lint-proto"
]
},
"validate": {
"targets": [
"lint",
"validate-vendor",
"validate-doctoc",
"validate-generated-files",
"validate-shfmt",
"validate-docs"
]
}
},
... But I also prefer to avoid using third-party tools and shell but rely on the node runtime and GHA SDK so we can handle exceptions more easily. We can also display debug output so user can figure out how this was computed:
Yes sounds good to handle matrix for a specific attribute so we can cover https://docs.docker.com/build/ci/github-actions/multi-platform/#with-bake use case as well. I think variable "DEFAULT_TAG" {
default = "app:local"
}
// Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
tags = ["${DEFAULT_TAG}"]
}
// Default target if none specified
group "default" {
targets = ["image-local"]
}
target "image" {
inherits = ["docker-metadata-action"]
}
target "image-local" {
inherits = ["image"]
output = ["type=docker"]
}
target "image-all" {
inherits = ["image"]
platforms = [
"linux/amd64",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64"
]
} -
name: Attribute matrix
id: matrix
uses: docker/bake-action/subaction/matrix-attribute@v4
with:
target: image-all
attribute: platforms Or maybe you think of having a single subaction doing both? |
This is great, thank you. Long term splitting across various platforms would be fantastic, not sure how that would work yet but it would be great if you could split it across specific runners so that ARM builds can be built using the appropriate runner as this will significantly reduce the build times. |
For the platforms split we would need a merge as well so it is more complicated. Maybe |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
1d468bc
to
c2495ac
Compare
Yes the platforms one is tricky. We need to save digests refs and then have another call to consume them. This should be feasible within a single action. |
fixes #117
https://github.com/crazy-max/docker-bake-action/tree/matrix-gen#list-targets