Teamwork makes the dream work for this multi-architecture builder.

Featured image

Teamwork makes the dream work for this multi-architecture builder Link to heading

There has never been a better time to start delivering Spring Boot applications to ARM64 architectures. I’ve been working on ARM64 buildpacks for over a year now and I want you to see how far things have come. These last few days have been leveled-up with help from Daniel Mikusa and Salman Malik, and the results are amazing.

So close Link to heading

I’m excited because the builder for ARM64 is so close to the AMD64 builder supported by Paketo. To see just how close things are, we can do a simple diff of the builders, from different architectures.

Optionally, clear cached images first

docker system prune -a --volumes -f

Inspect with ARM64 Link to heading

On an ARM64 device:

pack builder inspect dashaun/builder:tiny > ~/dashaun.builder.tiny.arm64

The file should look like this:

Inspecting builder: dashaun/builder:tiny

REMOTE:

Description: Tiny base image (bionic build image, distroless-like run image) with buildpacks for Java, Java Native Image and Go

Created By:
Name: Pack CLI
Version: 0.28.0+git-b10e41f.build-3729

Trusted: No

Stack:
ID: io.paketo.stacks.tiny

Lifecycle:
Version: 0.15.2
Buildpack APIs:
Deprecated: (none)
Supported: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9
Platform APIs:
Deprecated: (none)
Supported: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10

Run Images:
index.docker.io/paketobuildpacks/run:tiny-cnb
gcr.io/paketo-buildpacks/run:tiny-cnb

Buildpacks:
ID                                                  NAME                                                   VERSION        HOMEPAGE
paketo-buildpacks/apache-tomcat                     Paketo Buildpack for Apache Tomcat                     7.9.1          https://github.com/paketo-buildpacks/apache-tomcat
paketo-buildpacks/apache-tomee                      Paketo Buildpack for Apache Tomee                      1.4.0          https://github.com/paketo-buildpacks/apache-tomee
paketo-buildpacks/azure-application-insights        Paketo Buildpack for Azure Application Insights        5.9.3          https://github.com/paketo-buildpacks/azure-application-insights
paketo-buildpacks/bellsoft-liberica                 Paketo Buildpack for BellSoft Liberica                 9.10.1         https://github.com/paketo-buildpacks/bellsoft-liberica
paketo-buildpacks/ca-certificates                   Paketo Buildpack for CA Certificates                   3.5.1          https://github.com/paketo-buildpacks/ca-certificates
paketo-buildpacks/clojure-tools                     Paketo Buildpack for Clojure Tools                     2.6.1          https://github.com/paketo-buildpacks/clojure-tools
paketo-buildpacks/datadog                           Paketo Buildpack for Datadog                           3.1.0          https://github.com/paketo-buildpacks/datadog
paketo-buildpacks/dist-zip                          Paketo Buildpack for DistZip                           5.4.0          https://github.com/paketo-buildpacks/dist-zip
paketo-buildpacks/encrypt-at-rest                   Paketo Buildpack for Encrypt-at-Rest                   4.3.2          https://github.com/paketo-buildpacks/encrypt-at-rest
paketo-buildpacks/environment-variables             Paketo Buildpack for Environment Variables             4.4.0          https://github.com/paketo-buildpacks/environment-variables
paketo-buildpacks/executable-jar                    Paketo Buildpack for Executable JAR                    6.5.0          https://github.com/paketo-buildpacks/executable-jar
paketo-buildpacks/git                               Paketo Buildpack for Git                               1.0.0          https://github.com/paketo-buildpacks/git
paketo-buildpacks/go                                Paketo Buildpack for Go                                4.0.0          https://github.com/paketo-buildpacks/go
paketo-buildpacks/go-build                          Paketo Buildpack for Go Build                          2.0.7          https://github.com/paketo-buildpacks/go-build
paketo-buildpacks/go-dist                           Paketo Buildpack for Go Distribution                   2.2.2          https://github.com/paketo-buildpacks/go-dist
paketo-buildpacks/go-mod-vendor                     Paketo Buildpack for Go Mod Vendor                     1.0.6          https://github.com/paketo-buildpacks/go-mod-vendor
paketo-buildpacks/google-stackdriver                Paketo Buildpack for Google Stackdriver                7.0.0          https://github.com/paketo-buildpacks/google-stackdriver
paketo-buildpacks/gradle                            Paketo Buildpack for Gradle                            6.10.0         https://github.com/paketo-buildpacks/gradle
paketo-buildpacks/image-labels                      Paketo Buildpack for Image Labels                      4.3.0          https://github.com/paketo-buildpacks/image-labels
paketo-buildpacks/jattach                           Paketo Buildpack for JAttach                           1.2.0          https://github.com/paketo-buildpacks/jattach
paketo-buildpacks/java                              Paketo Buildpack for Java                              8.1.0          https://paketo.io/docs/howto/java
paketo-buildpacks/java-memory-assistant             Paketo Buildpack for Java Memory Assistant             1.2.0          https://github.com/paketo-buildpacks/java-memory-assistant
paketo-buildpacks/java-native-image                 Paketo Buildpack for Java Native Image                 7.42.0         https://paketo.io/docs/howto/java/#build-an-app-as-a-graalvm-native-image-application
paketo-buildpacks/leiningen                         Paketo Buildpack for Leiningen                         4.4.0          https://github.com/paketo-buildpacks/leiningen
paketo-buildpacks/liberty                           Paketo Buildpack for Liberty                           3.1.0          https://github.com/paketo-buildpacks/liberty
paketo-buildpacks/maven                             Paketo Buildpack for Maven                             6.11.0         https://github.com/paketo-buildpacks/maven
paketo-buildpacks/native-image                      Paketo Buildpack for Native Image                      5.6.0          https://github.com/paketo-buildpacks/native-image
paketo-buildpacks/procfile                          Paketo Buildpack for Procfile                          5.5.0          https://github.com/paketo-buildpacks/procfile
paketo-buildpacks/sbt                               Paketo Buildpack for SBT                               6.9.0          https://github.com/paketo-buildpacks/sbt
paketo-buildpacks/spring-boot                       Paketo Buildpack for Spring Boot                       5.20.0         https://github.com/paketo-buildpacks/spring-boot
paketo-buildpacks/syft                              Paketo Buildpack for Syft                              1.23.0         https://github.com/paketo-buildpacks/syft
paketo-buildpacks/upx                               Paketo Buildpack for UPX                               3.3.0          https://github.com/paketo-buildpacks/upx
paketo-buildpacks/watchexec                         Paketo Buildpack for Watchexec                         2.7.0          https://github.com/paketo-buildpacks/watchexec

Detection Order:
├ Group #1:
│  └ paketo-buildpacks/[email protected]
│     └ Group #1:
│        ├ paketo-buildpacks/[email protected]          (optional)
│        ├ paketo-buildpacks/[email protected]                      (optional)
│        ├ paketo-buildpacks/[email protected]
│        ├ paketo-buildpacks/[email protected]                    (optional)
│        ├ paketo-buildpacks/[email protected]                (optional)
│        ├ paketo-buildpacks/[email protected]                  (optional)
│        ├ paketo-buildpacks/[email protected]                   (optional)
│        ├ paketo-buildpacks/[email protected]                      (optional)
│        ├ paketo-buildpacks/[email protected]           (optional)
│        ├ paketo-buildpacks/[email protected]             (optional)
│        ├ paketo-buildpacks/[email protected]
│        ├ paketo-buildpacks/[email protected]                 (optional)
│        ├ paketo-buildpacks/[email protected]    (optional)
│        └ paketo-buildpacks/[email protected]             (optional)
├ Group #2:
│  └ paketo-buildpacks/[email protected]
│     └ Group #1:
│        ├ paketo-buildpacks/[email protected]               (optional)
│        ├ paketo-buildpacks/[email protected]
│        ├ paketo-buildpacks/[email protected]                         (optional)
│        ├ paketo-buildpacks/[email protected]                     (optional)
│        ├ paketo-buildpacks/[email protected]                 (optional)
│        ├ paketo-buildpacks/[email protected]                       (optional)
│        ├ paketo-buildpacks/[email protected]                        (optional)
│        ├ paketo-buildpacks/[email protected]                           (optional)
│        ├ paketo-buildpacks/[email protected]                     (optional)
│        ├ paketo-buildpacks/[email protected]                (optional)
│        ├ paketo-buildpacks/[email protected]                 (optional)
│        ├ paketo-buildpacks/[email protected]                  (optional)
│        ├ paketo-buildpacks/[email protected]                       (optional)
│        ├ paketo-buildpacks/[email protected]                      (optional)
│        ├ paketo-buildpacks/[email protected]                  (optional)
│        ├ paketo-buildpacks/[email protected]                      (optional)
│        ├ paketo-buildpacks/[email protected]                       (optional)
│        ├ paketo-buildpacks/[email protected]    (optional)
│        ├ paketo-buildpacks/[email protected]            (optional)
│        ├ paketo-buildpacks/[email protected]                       (optional)
│        ├ paketo-buildpacks/[email protected]         (optional)
│        ├ paketo-buildpacks/[email protected]               (optional)
│        ├ paketo-buildpacks/[email protected]         (optional)
│        └ paketo-buildpacks/[email protected]                  (optional)
├ Group #3:
│  ├ paketo-buildpacks/[email protected]
│  │  └ Group #1:
│  │     ├ paketo-buildpacks/[email protected]          (optional)
│  │     ├ paketo-buildpacks/[email protected]                (optional)
│  │     ├ paketo-buildpacks/[email protected]
│  │     ├ paketo-buildpacks/[email protected]                      (optional)
│  │     ├ paketo-buildpacks/[email protected]
│  │     ├ paketo-buildpacks/[email protected]
│  │     ├ paketo-buildpacks/[email protected]                 (optional)
│  │     ├ paketo-buildpacks/[email protected]    (optional)
│  │     └ paketo-buildpacks/[email protected]             (optional)
│  └ paketo-buildpacks/[email protected]
│     └ Group #2:
│        ├ paketo-buildpacks/[email protected]          (optional)
│        ├ paketo-buildpacks/[email protected]                (optional)
│        ├ paketo-buildpacks/[email protected]
│        ├ paketo-buildpacks/[email protected]                      (optional)
│        ├ paketo-buildpacks/[email protected]
│        ├ paketo-buildpacks/[email protected]                 (optional)
│        ├ paketo-buildpacks/[email protected]    (optional)
│        └ paketo-buildpacks/[email protected]             (optional)
└ Group #4:
└ paketo-buildpacks/[email protected]

LOCAL:
(not present)

Inspect with AMD64 Link to heading

On an AMD64 device:

pack builder inspect dashaun/builder:tiny > ~/dashaun.builder.tiny.amd64

The file will look very similar:

Inspecting builder: dashaun/builder:tiny

REMOTE:

Description: Tiny base image (bionic build image, distroless-like run image) with buildpacks for Java, Java Native Image and Go

Created By:
  Name: Pack CLI
  Version: 0.28.0+git-b10e41f.build-3729

Trusted: No

Stack:
  ID: io.paketo.stacks.tiny

Lifecycle:
  Version: 0.15.2
  Buildpack APIs:
    Deprecated: (none)
    Supported: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9
  Platform APIs:
    Deprecated: (none)
    Supported: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10

Run Images:
  index.docker.io/paketobuildpacks/run:tiny-cnb
  gcr.io/paketo-buildpacks/run:tiny-cnb

Buildpacks:
  ID                                                  NAME                                                   VERSION        HOMEPAGE
  paketo-buildpacks/apache-tomcat                     Paketo Buildpack for Apache Tomcat                     7.9.1          https://github.com/paketo-buildpacks/apache-tomcat
  paketo-buildpacks/apache-tomee                      Paketo Buildpack for Apache Tomee                      1.4.0          https://github.com/paketo-buildpacks/apache-tomee
  paketo-buildpacks/azure-application-insights        Paketo Buildpack for Azure Application Insights        5.9.3          https://github.com/paketo-buildpacks/azure-application-insights
  paketo-buildpacks/bellsoft-liberica                 Paketo Buildpack for BellSoft Liberica                 9.10.1         https://github.com/paketo-buildpacks/bellsoft-liberica
  paketo-buildpacks/ca-certificates                   Paketo Buildpack for CA Certificates                   3.5.1          https://github.com/paketo-buildpacks/ca-certificates
  paketo-buildpacks/clojure-tools                     Paketo Buildpack for Clojure Tools                     2.6.1          https://github.com/paketo-buildpacks/clojure-tools
  paketo-buildpacks/datadog                           Paketo Buildpack for Datadog                           3.1.0          https://github.com/paketo-buildpacks/datadog
  paketo-buildpacks/dist-zip                          Paketo Buildpack for DistZip                           5.4.0          https://github.com/paketo-buildpacks/dist-zip
  paketo-buildpacks/encrypt-at-rest                   Paketo Buildpack for Encrypt-at-Rest                   4.3.2          https://github.com/paketo-buildpacks/encrypt-at-rest
  paketo-buildpacks/environment-variables             Paketo Buildpack for Environment Variables             4.4.0          https://github.com/paketo-buildpacks/environment-variables
  paketo-buildpacks/executable-jar                    Paketo Buildpack for Executable JAR                    6.5.0          https://github.com/paketo-buildpacks/executable-jar
  paketo-buildpacks/git                               Paketo Buildpack for Git                               1.0.0          https://github.com/paketo-buildpacks/git
  paketo-buildpacks/go                                Paketo Buildpack for Go                                4.0.0          https://github.com/paketo-buildpacks/go
  paketo-buildpacks/go-build                          Paketo Buildpack for Go Build                          2.0.7          https://github.com/paketo-buildpacks/go-build
  paketo-buildpacks/go-dist                           Paketo Buildpack for Go Distribution                   2.2.2          https://github.com/paketo-buildpacks/go-dist
  paketo-buildpacks/go-mod-vendor                     Paketo Buildpack for Go Mod Vendor                     1.0.6          https://github.com/paketo-buildpacks/go-mod-vendor
  paketo-buildpacks/google-stackdriver                Paketo Buildpack for Google Stackdriver                7.0.0          https://github.com/paketo-buildpacks/google-stackdriver
  paketo-buildpacks/gradle                            Paketo Buildpack for Gradle                            6.10.0         https://github.com/paketo-buildpacks/gradle
  paketo-buildpacks/image-labels                      Paketo Buildpack for Image Labels                      4.3.0          https://github.com/paketo-buildpacks/image-labels
  paketo-buildpacks/jattach                           Paketo Buildpack for JAttach                           1.2.0          https://github.com/paketo-buildpacks/jattach
  paketo-buildpacks/java                              Paketo Buildpack for Java                              8.1.0          https://paketo.io/docs/howto/java
  paketo-buildpacks/java-memory-assistant             Paketo Buildpack for Java Memory Assistant             1.2.0          https://github.com/paketo-buildpacks/java-memory-assistant
  paketo-buildpacks/java-native-image                 Paketo Buildpack for Java Native Image                 7.42.0         https://paketo.io/docs/howto/java/#build-an-app-as-a-graalvm-native-image-application
  paketo-buildpacks/leiningen                         Paketo Buildpack for Leiningen                         4.4.0          https://github.com/paketo-buildpacks/leiningen
  paketo-buildpacks/liberty                           Paketo Buildpack for Liberty                           3.1.0          https://github.com/paketo-buildpacks/liberty
  paketo-buildpacks/maven                             Paketo Buildpack for Maven                             6.11.0         https://github.com/paketo-buildpacks/maven
  paketo-buildpacks/native-image                      Paketo Buildpack for Native Image                      5.6.0          https://github.com/paketo-buildpacks/native-image
  paketo-buildpacks/procfile                          Paketo Buildpack for Procfile                          5.5.0          https://github.com/paketo-buildpacks/procfile
  paketo-buildpacks/sbt                               Paketo Buildpack for SBT                               6.9.0          https://github.com/paketo-buildpacks/sbt
  paketo-buildpacks/spring-boot                       Paketo Buildpack for Spring Boot                       5.20.0         https://github.com/paketo-buildpacks/spring-boot
  paketo-buildpacks/syft                              Paketo Buildpack for Syft                              1.23.0         https://github.com/paketo-buildpacks/syft
  paketo-buildpacks/upx                               Paketo Buildpack for UPX                               3.3.0          https://github.com/paketo-buildpacks/upx
  paketo-buildpacks/watchexec                         Paketo Buildpack for Watchexec                         2.7.0          https://github.com/paketo-buildpacks/watchexec

Detection Order:
 ├ Group #1:
 │  └ paketo-buildpacks/[email protected]
 │     └ Group #1:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]                      (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                    (optional)
 │        ├ paketo-buildpacks/[email protected]                (optional)
 │        ├ paketo-buildpacks/[email protected]                  (optional)
 │        ├ paketo-buildpacks/[email protected]                   (optional)
 │        ├ paketo-buildpacks/[email protected]                      (optional)
 │        ├ paketo-buildpacks/[email protected]           (optional)
 │        ├ paketo-buildpacks/[email protected]             (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 ├ Group #2:
 │  └ paketo-buildpacks/[email protected]
 │     └ Group #1:
 │        ├ paketo-buildpacks/[email protected]               (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                         (optional)
 │        ├ paketo-buildpacks/[email protected]                     (optional)
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]                       (optional)
 │        ├ paketo-buildpacks/[email protected]                        (optional)
 │        ├ paketo-buildpacks/[email protected]                           (optional)
 │        ├ paketo-buildpacks/[email protected]                     (optional)
 │        ├ paketo-buildpacks/[email protected]                (optional)
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]                  (optional)
 │        ├ paketo-buildpacks/[email protected]                       (optional)
 │        ├ paketo-buildpacks/[email protected]                      (optional)
 │        ├ paketo-buildpacks/[email protected]                  (optional)
 │        ├ paketo-buildpacks/[email protected]                      (optional)
 │        ├ paketo-buildpacks/[email protected]                       (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        ├ paketo-buildpacks/[email protected]            (optional)
 │        ├ paketo-buildpacks/[email protected]                       (optional)
 │        ├ paketo-buildpacks/[email protected]         (optional)
 │        ├ paketo-buildpacks/[email protected]               (optional)
 │        ├ paketo-buildpacks/[email protected]         (optional)
 │        └ paketo-buildpacks/[email protected]                  (optional)
 ├ Group #3:
 │  ├ paketo-buildpacks/[email protected]
 │  │  └ Group #1:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]                (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                      (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  └ paketo-buildpacks/[email protected]
 │     └ Group #2:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]                (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                      (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 └ Group #4:
    └ paketo-buildpacks/[email protected]

LOCAL:
(not present)

Now, take a look at the diff between those two files:

diff dashaun.builder.tiny.arm64 dashaun.builder.tiny.amd64

As I’m writing this, the diff looks like this:

< Inspecting builder: 'dashaun/builder:tiny'
---
> Inspecting builder: 'paketobuildpacks/builder:tiny'
11c11
< Trusted: No
---
> Trusted: Yes

When you use dashaun/builder:tiny on ARM64, you are getting dashaun/builder:tiny which is my version. If you use dashaun/builder:tiny on AMD64, you are actually using paketobuildpacks/builder:tiny from Paketo. So this is an easy way, to use my unsupported builder when you are on ARM64, and stay with the supported upstream on AMD64.

Teamwork Link to heading

I’ve delivered dozens of stacks, buildpacks, and builders. It took a couple of hours of pairing with Salman Malik, to get to the nice diff with upstream. I also spent a few hours on Slack with Daniel Mikusa, cleaning and troubleshooting the manifest creation.

UPX Link to heading

Another big milestone from this work, is that UPX compression now works on ARM64. Well, it was working for a while, then it was broken, but now it’s working again. When it was working before, the containers were still rather large, so you couldn’t really see the value of the UPX compression. By taking the time to upgrade the underlying stack from Ubuntu Focal to Ubuntu Jammy I was also able to reduce the UPX compressed OCI image size.

Check out the difference this makes for dev.dashaun.service.gateway, the example I worked on last week.

$ docker images | grep gateway
dashaun/dev.dashaun.service.gateway  0.0.4  3f91fcfc6324  42 years ago  194MB
dashaun/dev.dashaun.service.gateway  0.0.5  f5d179a7b5c7  42 years ago  49.7MB

These images are public on my Docker Hub.

Paketo 2023 Roadmap Discussion Link to heading

I found out yesterday, now I’m sharing with you today, December 12, 2022. The discussion for the Paketo 2023 Roadmap is open. I would really appreciate any support you could put toward prioritizing ARM64 in this open discussion.

Keep Learning Link to heading