imbajin commented on code in PR #3171:
URL: https://github.com/apache/hugegraph/pull/3171#discussion_r3853561965


##########
docker-bake.hcl:
##########
@@ -0,0 +1,116 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+variable "MAVEN_ARGS" {
+  default = ""
+}
+
+variable "SOURCE_REVISION" {
+  default = "local"
+}
+
+variable "IMAGE_TAG" {
+  default = "local"
+}
+
+variable "CACHE_CHANNEL" {
+  default = "latest"
+}
+
+variable "EXPORT_CACHE" {
+  default = false
+}
+
+target "_common" {
+  context = "."
+  args = {
+    MAVEN_ARGS     = MAVEN_ARGS
+    SOURCE_REVISION = SOURCE_REVISION
+  }
+  platforms = [
+    "linux/amd64",
+    "linux/arm64",
+  ]
+}
+
+target "build-cache" {
+  inherits   = ["_common"]
+  dockerfile = "hugegraph-pd/Dockerfile"
+  target     = "build"
+  output     = ["type=cacheonly"]
+  cache-from = [
+    "type=registry,ref=hugegraph/hugegraph:shared-${CACHE_CHANNEL}",
+    "type=registry,ref=hugegraph/pd:buildcache-${CACHE_CHANNEL}",
+  ]
+  cache-to = EXPORT_CACHE ? [
+    "type=registry,ref=hugegraph/hugegraph:shared-${CACHE_CHANNEL},mode=max",
+  ] : []
+}
+
+target "pd" {
+  inherits   = ["_common"]
+  dockerfile = "hugegraph-pd/Dockerfile"
+  tags       = ["hugegraph/pd:${IMAGE_TAG}"]
+  output     = ["type=docker"]

Review Comment:
   ‼️ critical — `_common` supplies both `linux/amd64` and `linux/arm64`, but 
this target fixes the output to `type=docker` (and the other three runtime 
targets do the same). Buildx's Docker exporter only writes a single-platform 
image; with these two platforms the target cannot export the required manifest 
list, so the default Bake group cannot build the claimed multi-platform images. 
Please use a multi-platform-capable `registry`/`image` exporter for the 
publishing graph, or split out a single-platform local target, and make the CI 
guard validate the actual export contract.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to