Skip to content
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

ci: enable validating all Dockerfiles #5248

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

tonistiigi
Copy link
Member

No description provided.

@github-actions github-actions bot added area/project area/hack building buildkit itself labels Aug 13, 2024
Comment on lines +41 to +43
FROM --platform=linux/amd64 psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated-amd64

FROM go-mod-outdated-amd64 AS go-mod-outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't catch this was not a multiplatform image, we should be able to build the tool in this Dockerfile instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
name = "validate-dockerfile-${md5(dockerfile)}"
dockerfile = dockerfile
call = "check"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related but I found that build record should not be exported for this kind of target:

image

It tries to export the build record because buildx.build.ref is set in the metadata file: https://github.com/moby/buildkit/actions/runs/10366089572/job/28694600862#step:5:268

   {
    "validate-dockerfile-5a93df9b3286bc4794aa2096155c26b8": {
      "buildx.build.ref": "builder-acfc342a-63d0-4501-8680-844fa82ca061/builder-acfc342a-63d0-4501-8680-844fa82ca0610/5jqkz6fanf8rsqd1mqgjq5off",
      "result.json": "{\n  \"warnings\": null,\n  \"sources\": [\n    {\n      \"filename\": \"shfmt.Dockerfile\",\n      \"data\": \"IyBzeW50YXg9ZG9ja2VyL2RvY2tlcmZpbGUtdXBzdHJlYW06bWFzdGVyCgpGUk9NIG12ZGFuL3NoZm10OnYzLjEuMi1hbHBpbmUgQVMgc2hmbXQKV09SS0RJUiAvc3JjCkFSRyBTSEZNVF9GTEFHUz0iLWkgMiAtY2kiCgpGUk9NIHNoZm10IEFTIGdlbmVyYXRlCldPUktESVIgL291dC9oYWNrClJVTiAtLW1vdW50PXRhcmdldD0vc3JjIFwKICBjcCAtYSAvc3JjL2hhY2svLiAuLyAmJiBcCiAgc2hmbXQgLWwgLXcgJFNIRk1UX0ZMQUdTIC4KCkZST00gc2NyYXRjaCBBUyB1cGRhdGUKQ09QWSAtLWZyb209Z2VuZXJhdGUgL291dCAvCgpGUk9NIHNoZm10IEFTIHZhbGlkYXRlClJVTiAtLW1vdW50PXRhcmdldD0uIFwKICBzaGZtdCAkU0hGTVRfRkxBR1MgLWQgLi9oYWNrCg==\",\n      \"definition\": {\n        \"def\": [\n          \"GsQBChJsb2NhbDovL2RvY2tlcmZpbGUSFAoMbG9jYWwuZGlmZmVyEgRub25lEkkKEWxvY2FsLmZvbGxvd3BhdGhzEjRbInNoZm10LkRvY2tlcmZpbGUiLCJzaGZtdC5Eb2NrZXJmaWxlLmRvY2tlcmlnbm9yZSJdEioKDWxvY2FsLnNlc3Npb24SGXZpc2dpbzVucG4wN3EzZXpwZDF0MWJ3NHQSIQoTbG9jYWwuc2hhcmVka2V5aGludBIKZG9ja2VyZmlsZVoA\",\n          \"CkkKR3NoYTI1NjpmOTgyMTAzMjk5MzVkZDQwMWE0NGVhMDQ5MDU3MjRlYWNhMjcyMmM1NWU5N2ViNTFhNGE5NWNkMjBmZjEwYWM2\"\n        ],\n        \"metadata\": {\n          \"sha256:3f97713c82a92b5d9c8289e6d3aaf8cd7c37b6bca4600043f313430130e1e3b7\": {\n            \"caps\": {\n              \"constraints\": true,\n              \"meta.description\": true,\n              \"platform\": true\n            }\n          },\n          \"sha256:f98210329935dd401a44ea04905724eaca2722c55e97eb51a4a95cd20ff10ac6\": {\n            \"description\": {\n              \"llb.customname\": \"[internal] load build definition from shfmt.Dockerfile\"\n            },\n            \"caps\": {\n              \"source.local\": true,\n              \"source.local.followpaths\": true,\n              \"source.local.sessionid\": true,\n              \"source.local.sharedkeyhint\": true\n            }\n          }\n        },\n        \"Source\": {\n          \"locations\": {\n            \"sha256:f98210329935dd401a44ea04905724eaca2722c55e97eb51a4a95cd20ff10ac6\": {}\n          }\n        }\n      },\n      \"language\": \"Dockerfile\"\n    }\n  ]\n}",
      "result.statuscode": "0",
      "result.txt": "",
      "version": "1.0.0"
    }
  }

I think we should omit setting it for subrequests. Will open a PR on Buildx to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hack building buildkit itself area/project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants