gemini-code-assist[bot] commented on code in PR #39409:
URL: https://github.com/apache/beam/pull/39409#discussion_r3624347429
##########
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy:
##########
@@ -235,13 +239,23 @@ class BeamDockerPlugin implements Plugin<Project> {
if (!ext.platform.isEmpty()) {
buildCommandLine.addAll('--platform', String.join(',', ext.platform))
}
- if (ext.load) {
- buildCommandLine.add '--load'
+ if (ext.load && ext.push) {
+ throw new Exception("cannot combine 'push' and 'load' options")
}
- if (ext.push) {
- buildCommandLine.add '--push'
+ if (ext.compression != null && !ext.compression.isEmpty()) {
+ if (ext.push) {
+ buildCommandLine.add
"--output=type=registry,compression=${ext.compression},force-compression=true,oci-mediatypes=true"
+ } else if (ext.load) {
+ buildCommandLine.add
"--output=type=docker,compression=${ext.compression},force-compression=true"
Review Comment:

The Docker `docker` exporter (`type=docker`) used for loading images locally
does not support the `compression` or `force-compression` parameters.
Attempting to pass these parameters will result in a build failure (e.g.,
`error: compression/force-compression is not supported for docker exporter`).
Since `compression` defaults to `'zstd'`, any local build that has `load`
enabled (which is the default for local testing) will fail.
To fix this, we should fall back to the standard `--load` option (which is
shorthand for `type=docker` without compression parameters) when `ext.load` is
true.
```
} else if (ext.load) {
buildCommandLine.add '--load'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]