-
Notifications
You must be signed in to change notification settings - Fork 510
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
Add metadata-file
flag
#605
Conversation
9d9e812
to
e93dc9d
Compare
I think this would be better as metadata-file (eg. moby/buildkit#2095) and one per bake that lists all properties for all built targets instead of a file per target. @AkihiroSuda thoughts? |
SGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
Ok here is the current state on my side:
|
@crazy-max SGTM. Having both /~https://github.com/moby/buildkit/pull/2095/files added flag with a dash. I think the dash is better. |
Agree about deprecation of
Yes, I was wondering if we were keeping the same format as for iidfile but since we could deprecate it I will modify it to |
affca3a
to
6195760
Compare
@tonistiigi Ok now variable "DEFAULT_TAG" {
default = "7zip: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",
"linux/386",
"linux/ppc64le",
"linux/s390x"
]
} docker buildx bake --metadata-file metadata.json image-local
{
"metadata": {
"build-opts": {
"inputs": {
"context": ".",
"dockerfile": "Dockerfile"
},
"tags": [
"7zip:local"
],
"metadata-file": "./metadata.json"
},
"solve-opts": [
{
"containerimage.config.digest": "sha256:fe4387b1cf24e8b3f153b026e2843e8abddeda479b27fd6adf3ed7ad1f8eb67a",
"containerimage.digest": "sha256:3eaf8fb892e653224be132bc26de3bfa82e4563750b5f1f6dd64ae25788c6247",
"image.name": "docker.io/library/7zip:local"
}
]
}
} docker buildx build --output type=docker --metadata-file ./metadata.json .
{
"metadata": {
"build-opts": {
"inputs": {
"context": "."
},
"metadata-file": "./metadata.json",
"network-mode": "default"
},
"solve-opts": [
{
"containerimage.config.digest": "sha256:fe4387b1cf24e8b3f153b026e2843e8abddeda479b27fd6adf3ed7ad1f8eb67a",
"containerimage.digest": "sha256:3eaf8fb892e653224be132bc26de3bfa82e4563750b5f1f6dd64ae25788c6247"
}
]
}
} Let me know if it's the right direction. |
I thought this was just going to contain the build result metadata. Why is that part called For the bake, the key should be Not related to this PR code but what is |
Yes I was wondering about naming. Will call it
I wanted to see if it could be interesting in the future indeed. We can do this in a follow-up instead.
Ok I can make a representation per-target
Will be empty: docker buildx bake --set *.tags=crazymax/7zip:test --push --metadata-file ./metadata.json image-all {
"metadata": {
"build-opts": {
"inputs": {
"context": ".",
"dockerfile": "Dockerfile"
},
"tags": [
"crazymax/7zip:test"
],
"metadata-file": "./metadata.json",
"platform": [
{
"architecture": "amd64",
"os": "linux"
},
{
"architecture": "arm",
"os": "linux",
"variant": "v6"
},
{
"architecture": "arm",
"os": "linux",
"variant": "v7"
},
{
"architecture": "arm64",
"os": "linux"
},
{
"architecture": "386",
"os": "linux"
},
{
"architecture": "ppc64le",
"os": "linux"
},
{
"architecture": "s390x",
"os": "linux"
}
]
},
"solve-opts": [
{
"containerimage.digest": "sha256:61ba426e49e207972d9ffaf6761cffec9fb3ae63dab76414cf250c9058370643",
"image.name": "crazymax/7zip:test"
}
]
}
} |
This comment has been minimized.
This comment has been minimized.
2a4b27d
to
55e8aa2
Compare
893b749
to
e17f173
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
ede2824
to
199509e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments. Overall looks good 👍
99ad3d3
to
506f0f7
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we import ioutils
you can remove the duplicate function in store
pkg in follow-up.
cc. @tonistiigi
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com