Skip to content

Commit

Permalink
build(oci): add config to allow building images for other archs (#1352)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Jun 13, 2023
1 parent 04ca4e2 commit 20ea619
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Build Requirements:
- JDK17+
- Maven 3+
- Podman 2.0+
- `qemu-user-static` to build container images for other archs

Run Requirements:
- Kubernetes/OpenShift/Minishift, Podman/Docker, or other container platform
Expand Down
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

<imageBuilder>/usr/bin/podman</imageBuilder>

<build.os>linux</build.os>
<build.arch>amd64</build.arch>
<baseImage>localhost/cryostat-base</baseImage>
<baseImageTag>latest</baseImageTag>
<baseImageTag>latest-${build.os}-${build.arch}</baseImageTag>
<baseImageTarball>base.tar.gz</baseImageTarball>
<node.version>v16.18.1</node.version>
<yarn.version>v1.22.19</yarn.version>
Expand Down Expand Up @@ -435,6 +437,8 @@
<executable>${imageBuilder}</executable>
<arguments>
<argument>build</argument>
<argument>--platform</argument>
<argument>${build.os}/${build.arch}</argument>
<argument>--file</argument>
<argument>${project.build.outputDirectory}/Dockerfile</argument>
<argument>--tag</argument>
Expand Down Expand Up @@ -753,10 +757,16 @@
</dockerClient>
<from>
<image>tar://${project.build.directory}/${baseImageTarball}</image>
<platforms>
<platform>
<os>${build.os}</os>
<architecture>${build.arch}</architecture>
</platform>
</platforms>
</from>
<to>
<image>${cryostat.imageStream}</image>
<tags>${cryostat.imageVersionLower}</tags>
<tags>${cryostat.imageVersionLower}-${build.os}-${build.arch}</tags>
</to>
<container>
<format>OCI</format>
Expand Down

0 comments on commit 20ea619

Please sign in to comment.