You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/inc/build/_buildx.adoc
+15-9
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,21 @@
1
1
2
2
[[build-buildx]]
3
3
4
-
Buildx is enabled when there is a non-empty `<platform>` element inside the `<buildx>` configuration. Only the native platform
5
-
is built and saved in the local image cache by the `build` goal. All specified platforms are built and pushed into the remote
6
-
repository by the `push` goal. This behavior is to prevent non-native images from tainting the local image cache.
4
+
Buildx is enabled when there is a non-empty `<platform>` element inside the `<buildx>` configuration.
7
5
8
-
The local image cache cannot hold multi-architecture images nor can it have two platform specific images of the same name. The
9
-
recommended `<buildx>` configuration is to specify all supported platforms, including the native platform, in the `<platforms>`
10
-
element. This allows local integration testing of the build image from the local cache. During install or deploy phase, the
11
-
build machine will build and push all images to the registry. Any downstream consumers, regardless of native architecture, will
12
-
be able to use the multi-architecture image.
6
+
The local image cache cannot hold multi-architecture images nor can it have two platform specific images of the same name.
7
+
Thus the `build` goal will build and save a single-architecture image to the local image cache if possible:
8
+
9
+
* If the `<platform>` element contains a single platform, that image will be built.
10
+
* If the `<platform>` element contains more than one platform including the native platform, the native platform be used.
11
+
* If the `<platform>` element contains more than one platform not including the native platform, no image will be built.
12
+
13
+
These rules only apply to the image built and loaded into the local image cache with the `build` goal. They do not apply to the `push` goal which will always build and push either a single-architecture or multi-architecture image with whatever platforms are specified in the `<platform>` element.
14
+
15
+
The recommended `<buildx>` configuration is to specify all supported platforms, including the native platform, in the
16
+
`<platform>` element. This allows local integration testing of the build image from the local cache. During install or deploy
17
+
phase, the build machine will build and push a multi-architecture image containing all specified platforms to the registry.
18
+
Any downstream consumers, regardless of native architecture, will be able to use the multi-architecture image.
13
19
14
20
The `<buildx>` element within `<build>` defines how to build multi-architecture images.
15
21
@@ -75,4 +81,4 @@ You can now override the built platforms using a command line define:
0 commit comments