GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: set record status in response by crazy-max · Pull Request #2511 · docker/buildx

Conversation

@crazy-max

@crazy-max crazy-max commented Jun 11, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Similar to #2280, we can set build checks warnings in the metadata file. Does not set anything by default but can be customized using the BUILDX_METADATA_STATUS environment variable to set just warnings or full status.

This will be useful with our GitHub Actions so we can generate GitHub Annotations without having to do a subrequest build like in https://github.com/crazy-max/docker-build-push-action/pull/39/files#diff-4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3dR132

Output example in e2e workflow: https://github.com/docker/buildx/actions/runs/9498949574/job/26178830826#step:9:201

# syntax=docker/dockerfile-upstream:master
frOM busybox as base
cOpy Dockerfile .

from scratch
COPy --from=base \
  /Dockerfile \
  /
$ BUILDX_METADATA_STATUS=warnings docker buildx build . --metadata-file md.json
...
#12 exporting to image
#12 exporting layers done
#12 writing image sha256:d0bb2193d26744307a7003c5397e277d1fa73ee979851b0c2ed2afad89d2e44b done
#12 DONE 0.0s

#13 resolving provenance for metadata file
#13 DONE 0.0s

#14 resolving status for metadata file
#14 DONE 0.0s

 3 warnings found (use --debug to expand):
 - ConsistentInstructionCasing: Command 'frOM' should be consistently cased (line 2)
 - ConsistentInstructionCasing: Command 'cOpy' should be consistently cased (line 3)
 - ConsistentInstructionCasing: Command 'COPy' should be consistently cased (line 6)

View build details: docker-desktop://dashboard/build/default/default/wuiiyvfzfof6q93b69sp97n2l
{
  "buildx.build.provenance": {
    "buildType": "https://mobyproject.org/buildkit@v1",
    "materials": [
      {
        "uri": "pkg:docker/docker/dockerfile-upstream@master",
        "digest": {
          "sha256": "9935ee100536d9becebf9221786409606f46a51736e894796a6e983fae5e446f"
        }
      },
      {
        "uri": "pkg:docker/busybox@latest?platform=linux%2Famd64",
        "digest": {
          "sha256": "9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7"
        }
      }
    ],
    "invocation": {
      "configSource": {
        "entryPoint": "Dockerfile"
      },
      "parameters": {
        "frontend": "gateway.v0",
        "args": {
          "cmdline": "docker/dockerfile-upstream:master",
          "source": "docker/dockerfile-upstream:master"
        },
        "locals": [
          {
            "name": "context"
          },
          {
            "name": "dockerfile"
          }
        ]
      },
      "environment": {
        "platform": "linux/amd64"
      }
    }
  },
  "buildx.build.ref": "default/default/wuiiyvfzfof6q93b69sp97n2l",
  "buildx.build.status": {
    "warnings": [
      {
        "vertex": "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5",
        "level": 1,
        "short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdmck9NJyBzaG91bGQgYmUgY29uc2lzdGVudGx5IGNhc2VkIChsaW5lIDIp",
        "detail": [
          "SW5zdHJ1Y3Rpb25zIHNob3VsZCBiZSBpbiBjb25zaXN0ZW50IGNhc2luZyAoYWxsIGxvd2VyIG9yIGFsbCB1cHBlcik="
        ],
        "url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
        "sourceInfo": {
          "filename": "Dockerfile",
          "data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCmZyT00gYnVzeWJveCBhcyBiYXNlCmNPcHkgRG9ja2VyZmlsZSAuCgpmcm9tIHNjcmF0Y2gKQ09QeSAtLWZyb209YmFzZSBcCiAgL0RvY2tlcmZpbGUgXAogIC8K",
          "definition": {
            "def": [
              "GsUBChJsb2NhbDovL2RvY2tlcmZpbGUSFAoMbG9jYWwuZGlmZmVyEgRub25lEkoKEWxvY2FsLmZvbGxvd3BhdGhzEjVbIkRvY2tlcmZpbGUiLCJEb2NrZXJmaWxlLmRvY2tlcmlnbm9yZSIsImRvY2tlcmZpbGUiXRIqCg1sb2NhbC5zZXNzaW9uEhluOTMwNHpkYzM5Y3B6ajJndjF5MzBicjgwEiEKE2xvY2FsLnNoYXJlZGtleWhpbnQSCmRvY2tlcmZpbGVaAA==",
              "CkkKR3NoYTI1NjoxY2MyNDFmYjIwOGM4N2E0ZjQ4ZTRiZTg5NDY0ZjhiYjI3Nzg2YzYwYTI1NzFmYWY1ZDkxNTg0OTNiNzBhN2U1"
            ],
            "metadata": {
              "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {
                "description": {
                  "llb.customname": "[internal] load build definition from Dockerfile"
                },
                "caps": {
                  "source.local": true,
                  "source.local.followpaths": true,
                  "source.local.sessionid": true,
                  "source.local.sharedkeyhint": true
                }
              },
              "sha256:3e90e4df9cb0f8a6679e7bdf9d853abc823fc04386a4c5c226cea5f7d1bb4ac6": {
                "caps": {
                  "constraints": true,
                  "meta.description": true,
                  "platform": true
                }
              }
            },
            "Source": {
              "locations": {
                "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {}
              }
            }
          },
          "language": "Dockerfile"
        },
        "range": [
          {
            "start": {
              "line": 2
            },
            "end": {
              "line": 2
            }
          }
        ]
      },
      {
        "vertex": "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5",
        "level": 1,
        "short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdjT3B5JyBzaG91bGQgYmUgY29uc2lzdGVudGx5IGNhc2VkIChsaW5lIDMp",
        "detail": [
          "SW5zdHJ1Y3Rpb25zIHNob3VsZCBiZSBpbiBjb25zaXN0ZW50IGNhc2luZyAoYWxsIGxvd2VyIG9yIGFsbCB1cHBlcik="
        ],
        "url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
        "sourceInfo": {
          "filename": "Dockerfile",
          "data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCmZyT00gYnVzeWJveCBhcyBiYXNlCmNPcHkgRG9ja2VyZmlsZSAuCgpmcm9tIHNjcmF0Y2gKQ09QeSAtLWZyb209YmFzZSBcCiAgL0RvY2tlcmZpbGUgXAogIC8K",
          "definition": {
            "def": [
              "GsUBChJsb2NhbDovL2RvY2tlcmZpbGUSFAoMbG9jYWwuZGlmZmVyEgRub25lEkoKEWxvY2FsLmZvbGxvd3BhdGhzEjVbIkRvY2tlcmZpbGUiLCJEb2NrZXJmaWxlLmRvY2tlcmlnbm9yZSIsImRvY2tlcmZpbGUiXRIqCg1sb2NhbC5zZXNzaW9uEhluOTMwNHpkYzM5Y3B6ajJndjF5MzBicjgwEiEKE2xvY2FsLnNoYXJlZGtleWhpbnQSCmRvY2tlcmZpbGVaAA==",
              "CkkKR3NoYTI1NjoxY2MyNDFmYjIwOGM4N2E0ZjQ4ZTRiZTg5NDY0ZjhiYjI3Nzg2YzYwYTI1NzFmYWY1ZDkxNTg0OTNiNzBhN2U1"
            ],
            "metadata": {
              "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {
                "description": {
                  "llb.customname": "[internal] load build definition from Dockerfile"
                },
                "caps": {
                  "source.local": true,
                  "source.local.followpaths": true,
                  "source.local.sessionid": true,
                  "source.local.sharedkeyhint": true
                }
              },
              "sha256:3e90e4df9cb0f8a6679e7bdf9d853abc823fc04386a4c5c226cea5f7d1bb4ac6": {
                "caps": {
                  "constraints": true,
                  "meta.description": true,
                  "platform": true
                }
              }
            },
            "Source": {
              "locations": {
                "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {}
              }
            }
          },
          "language": "Dockerfile"
        },
        "range": [
          {
            "start": {
              "line": 3
            },
            "end": {
              "line": 3
            }
          }
        ]
      },
      {
        "vertex": "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5",
        "level": 1,
        "short": "Q29uc2lzdGVudEluc3RydWN0aW9uQ2FzaW5nOiBDb21tYW5kICdDT1B5JyBzaG91bGQgYmUgY29uc2lzdGVudGx5IGNhc2VkIChsaW5lIDYp",
        "detail": [
          "SW5zdHJ1Y3Rpb25zIHNob3VsZCBiZSBpbiBjb25zaXN0ZW50IGNhc2luZyAoYWxsIGxvd2VyIG9yIGFsbCB1cHBlcik="
        ],
        "url": "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
        "sourceInfo": {
          "filename": "Dockerfile",
          "data": "IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCmZyT00gYnVzeWJveCBhcyBiYXNlCmNPcHkgRG9ja2VyZmlsZSAuCgpmcm9tIHNjcmF0Y2gKQ09QeSAtLWZyb209YmFzZSBcCiAgL0RvY2tlcmZpbGUgXAogIC8K",
          "definition": {
            "def": [
              "GsUBChJsb2NhbDovL2RvY2tlcmZpbGUSFAoMbG9jYWwuZGlmZmVyEgRub25lEkoKEWxvY2FsLmZvbGxvd3BhdGhzEjVbIkRvY2tlcmZpbGUiLCJEb2NrZXJmaWxlLmRvY2tlcmlnbm9yZSIsImRvY2tlcmZpbGUiXRIqCg1sb2NhbC5zZXNzaW9uEhluOTMwNHpkYzM5Y3B6ajJndjF5MzBicjgwEiEKE2xvY2FsLnNoYXJlZGtleWhpbnQSCmRvY2tlcmZpbGVaAA==",
              "CkkKR3NoYTI1NjoxY2MyNDFmYjIwOGM4N2E0ZjQ4ZTRiZTg5NDY0ZjhiYjI3Nzg2YzYwYTI1NzFmYWY1ZDkxNTg0OTNiNzBhN2U1"
            ],
            "metadata": {
              "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {
                "description": {
                  "llb.customname": "[internal] load build definition from Dockerfile"
                },
                "caps": {
                  "source.local": true,
                  "source.local.followpaths": true,
                  "source.local.sessionid": true,
                  "source.local.sharedkeyhint": true
                }
              },
              "sha256:3e90e4df9cb0f8a6679e7bdf9d853abc823fc04386a4c5c226cea5f7d1bb4ac6": {
                "caps": {
                  "constraints": true,
                  "meta.description": true,
                  "platform": true
                }
              }
            },
            "Source": {
              "locations": {
                "sha256:1cc241fb208c87a4f48e4be89464f8bb27786c60a2571faf5d9158493b70a7e5": {}
              }
            }
          },
          "language": "Dockerfile"
        },
        "range": [
          {
            "start": {
              "line": 6
            },
            "end": {
              "line": 6
            }
          },
          {
            "start": {
              "line": 7
            },
            "end": {
              "line": 7
            }
          },
          {
            "start": {
              "line": 8
            },
            "end": {
              "line": 8
            }
          }
        ]
      }
    ]
  },
  "containerimage.config.digest": "sha256:d0bb2193d26744307a7003c5397e277d1fa73ee979851b0c2ed2afad89d2e44b",
  "containerimage.digest": "sha256:d0bb2193d26744307a7003c5397e277d1fa73ee979851b0c2ed2afad89d2e44b"
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max crazy-max added the area/build label Jun 11, 2024
@crazy-max
crazy-max force-pushed the metadata-warnings branch 4 times, most recently from 705b3f3 to aafd62e Compare June 11, 2024 18:36
@crazy-max crazy-max added this to the v0.16.0 milestone Jun 12, 2024
@crazy-max
crazy-max force-pushed the metadata-warnings branch from aafd62e to 4353850 Compare June 12, 2024 07:56
@crazy-max crazy-max mentioned this pull request Jun 12, 2024
buildkit: add types docker/actions-toolkit#359
Merged
@crazy-max
crazy-max force-pushed the metadata-warnings branch 5 times, most recently from 064c8cb to 128579d Compare June 13, 2024 11:54
crazy-max
crazy-max commented Jun 13, 2024
View reviewed changes
Comment thread tests/build.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max
crazy-max force-pushed the metadata-warnings branch 3 times, most recently from 8e001be to 9fce297 Compare June 13, 2024 12:24
@crazy-max
crazy-max marked this pull request as ready for review June 13, 2024 12:34
@crazy-max crazy-max added the status/code-review label Jun 13, 2024
@crazy-max crazy-max mentioned this pull request Jun 13, 2024
buildx(build): resolveWarnings from metadata docker/actions-toolkit#362
Merged
@crazy-max

crazy-max commented Jun 14, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Opened docker/actions-toolkit#362 as follow-up to consume this in our GitHub actions.

Edit: Also docker/actions-toolkit#365 to annotate checks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max crazy-max mentioned this pull request Jun 14, 2024
github: annotate build warnings docker/actions-toolkit#365
Merged
@crazy-max
crazy-max force-pushed the metadata-warnings branch from 9fce297 to e759a1b Compare June 18, 2024 11:10
@crazy-max

crazy-max commented Jun 18, 2024

Copy link
Copy Markdown
Member Author

@tonistiigi Updated to make it opt-in instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max
crazy-max requested a review from tonistiigi June 18, 2024 11:12
@crazy-max
build: set record status in response
415f88f
Signed-off-by: CrazyMax <[email protected]>
@crazy-max
crazy-max force-pushed the metadata-warnings branch from e759a1b to 415f88f Compare June 18, 2024 16:21
@crazy-max crazy-max changed the title build: set record status warnings in response build: set record status in response Jun 18, 2024
tonistiigi
tonistiigi reviewed Jun 20, 2024
View reviewed changes

@tonistiigi tonistiigi left a comment

Copy link
Copy Markdown
Member

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.

Sorry, I did not mean combining/replacing this with provenance opt-in when we discussed it. I meant adding another opt-in, similar to what we did with provenance.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tonistiigi
tonistiigi reviewed Jun 20, 2024
View reviewed changes
Comment thread build/record.go
return nil
}
pw = progress.ResetTime(pw)
return progress.Wrap("resolving status for metadata file", pw.Write, func(l progress.SubLogger) error {

@tonistiigi tonistiigi Jun 20, 2024

Copy link
Copy Markdown
Member

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.

I don't think this should be pulled via history API and new progress item added. You can get the warnings by calling printer.Warnings() from command packages.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@crazy-max crazy-max Jun 25, 2024

Copy link
Copy Markdown
Member Author

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.

Opened #2551 as alternative

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max crazy-max mentioned this pull request Jun 24, 2024
build: opt to set progress warnings in response #2551
Merged
@tonistiigi

tonistiigi commented Jun 25, 2024

Copy link
Copy Markdown
Member

replaced by #2551 ?

crazy-max reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max crazy-max closed this Jun 25, 2024
@crazy-max crazy-max removed this from the v0.16.0 milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tonistiigi tonistiigi tonistiigi left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/build status/code-review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@crazy-max @tonistiigi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.