docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.58k stars 482 forks source link

Add option to tune/disable checks #2704

Closed ag-TJNII closed 2 months ago

ag-TJNII commented 2 months ago

Description

I have a large and complex build pipeline with interdependencies. For several images there is no default value for build args, to build the image arguments must be set. The new build check system is nagging about this:

=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${DEPENDENCY_terraform_terragrunt_build_dependency_IMAGE} results in empty or invalid base image name (line 20)                                                                                   0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${DEPENDENCY_gcp_aws_common_base_IMAGE} results in empty or invalid base image name (line 27)

This system builds a fanout of versions and architectures. A default like latest is naive and incorrect in this context. The Dockerfile generating this warning is only ever intended to be built by the build system; an engineer rocking up and running docker build directly is not supported in this project.

Most linters allow disabling checks for this kind of scenario. For example:

However, based on https://docs.docker.com/reference/build-checks/, this feature in Docker Buildx appears to have been rolled out without a settings system.

Please add a way to disable checks in configuration for projects where there are reasons to not follow the general guidelines. This will avoid potential confusion when reading the build logs.

ag-TJNII commented 2 months ago

And the reason it appears to have been rolled out without a way to disable it is because ... 🥁 ... I didn't look hard enough.

https://docs.docker.com/build/checks/

User error.