admin管理员组

文章数量:1394778

I recently changed my computer from an old school Intel-based Macbook to an Apple Silicon (M1 Max) machine, and I'm trying to build a Docker Image using Spring boot. This image will be run on a Linux-based server. And the build/run image process does not work properly anymore...

Here is my pom.xml config:

<plugin>
    <groupId>.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <image>
            <name>${MODULE_DOCKER_IMAGE_NAME}</name>
            <publish>${MODULE_DOCKER_PUBLISH}</publish>
            <imagePlatform>${MODULE_DOCKER_PLATFORM}</imagePlatform>
        </image>
        <docker>
            <publishRegistry>
                <username>${MODULE_DOCKER_USER}</username>
                <password>${MODULE_DOCKER_PASSWORD}</password>
            </publishRegistry>
        </docker>
        <excludes>
            <exclude>
                <groupId>.projectlombok</groupId>
                <artifactId>lombok</artifactId>
            </exclude>
        </excludes>
    </configuration>
</plugin>

And I'm launching the build with the command:

mvn spring-boot:build-image -DskipTests=true -DMODULE_DOCKER_IMAGE_NAME=***/my-image:1.1.0 \
-DMODULE_DOCKER_USER=*** \
-DMODULE_DOCKER_PASSWORD=*** \
-DMODULE_DOCKER_PUBLISH=false \
-DMODULE_DOCKER_PLATFORM=linux/amd64 \
-DMODULE_DOCKER_REGISTRY=***

And I get the following error:

[INFO]     [creator]     ERROR: failed to export: saving image: failed to fetch base layers: saving image with ID "sha256:0c5ac79d549c4b077a7d857631f817f8b573f5da2c109a51f320ee584d44d3f2" from the docker daemon: Error response from daemon: unable to create manifests file: NotFound: content digest sha256:05cbce61634362ddc82e0d3ce86a6c812f0b2423070acecd8819c035ef8be68d: not found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.819 s
[INFO] Finished at: 2025-03-27T09:29:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal .springframework.boot:spring-boot-maven-plugin:3.4.4:build-image (default-cli) on project my-project: Execution default-cli of goal .springframework.boot:spring-boot-maven-plugin:3.4.4:build-image failed: Builder lifecycle 'creator' failed with status code 62 -> [Help 1]

Not sure what is going on or if I'm missing something?

Note: I'm using Spring boot 3.4.4, Docker Desktop 4.39.0

The complete logs are:

[INFO] --- spring-boot:3.4.4:build-image (default-cli) @ my-project ---
[INFO] Building image 'docker.io/***/my-image:1.1.0'
[INFO]
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 0%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 4%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 18%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 27%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 30%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 31%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 31%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 31%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 31%
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-java-tiny:latest' for platform 'linux/amd64' 100%
[INFO]  > Pulled builder image 'paketobuildpacks/builder-jammy-java-tiny@sha256:1f2bd39426f8e462f6d6177cb1504cf01211a134d51e2674f97176a8b17d8a55'
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run-jammy-tiny:latest' for platform 'linux/amd64' 2%
[INFO]  > Pulling run image 'docker.io/paketobuildpacks/run-jammy-tiny:latest' for platform 'linux/amd64' 100%
[INFO]  > Pulled run image 'paketobuildpacks/run-jammy-tiny@sha256:0c5ac79d549c4b077a7d857631f817f8b573f5da2c109a51f320ee584d44d3f2'
[INFO]  > Executing lifecycle version v0.20.7
[INFO]  > Using build cache volume 'pack-cache-526d635f760b.build'
[INFO]
[INFO]  > Running creator
[INFO]     [creator]     ===> ANALYZING
[INFO]     [creator]     Image with name "docker.io/***/my-image:1.1.0" not found
[INFO]     [creator]     ===> DETECTING
[INFO]     [creator]     target distro name/version labels not found, reading /etc/os-release file
[INFO]     [creator]     6 of 26 buildpacks participating
[INFO]     [creator]     paketo-buildpacks/ca-certificates   3.10.0
[INFO]     [creator]     paketo-buildpacks/bellsoft-liberica 11.2.0
[INFO]     [creator]     paketo-buildpacks/syft              2.10.0
[INFO]     [creator]     paketo-buildpacks/executable-jar    6.13.0
[INFO]     [creator]     paketo-buildpacks/dist-zip          5.10.0
[INFO]     [creator]     paketo-buildpacks/spring-boot       5.33.0
[INFO]     [creator]     ===> RESTORING
[INFO]     [creator]     ===> BUILDING
[INFO]     [creator]     target distro name/version labels not found, reading /etc/os-release file
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for CA Certificates 3.10.0
[INFO]     [creator]       
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_EMBED_CERTS                    false  Embed certificates into the image
[INFO]     [creator]         $BP_ENABLE_RUNTIME_CERT_BINDING    true   Deprecated: Enable/disable certificate helper layer to add certs at runtime
[INFO]     [creator]         $BP_RUNTIME_CERT_BINDING_DISABLED  false  Disable certificate helper layer to add certs at runtime
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for BellSoft Liberica 11.2.0
[INFO]     [creator]       
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_JLINK_ARGS           --no-man-pages --no-header-files --strip-debug --compress=1  configure custom link arguments (--output must be omitted)
[INFO]     [creator]         $BP_JVM_JLINK_ENABLED        false                                                        enables running jlink tool to generate custom JRE
[INFO]     [creator]         $BP_JVM_TYPE                 JRE                                                          the JVM type - JDK or JRE
[INFO]     [creator]         $BP_JVM_VERSION              21                                                           the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_DEBUG_ENABLED           false                                                        enables Java remote debugging support
[INFO]     [creator]         $BPL_DEBUG_PORT              8000                                                         configure the remote debugging port
[INFO]     [creator]         $BPL_DEBUG_SUSPEND           false                                                        configure whether to suspend execution until a debugger has attached
[INFO]     [creator]         $BPL_HEAP_DUMP_PATH                                                                       write heap dumps on error to this path
[INFO]     [creator]         $BPL_JAVA_NMT_ENABLED        true                                                         enables Java Native Memory Tracking (NMT)
[INFO]     [creator]         $BPL_JAVA_NMT_LEVEL          summary                                                      configure level of NMT, summary or detail
[INFO]     [creator]         $BPL_JFR_ARGS                                                                             configure custom Java Flight Recording (JFR) arguments
[INFO]     [creator]         $BPL_JFR_ENABLED             false                                                        enables Java Flight Recording (JFR)
[INFO]     [creator]         $BPL_JMX_ENABLED             false                                                        enables Java Management Extensions (JMX)
[INFO]     [creator]         $BPL_JMX_PORT                5000                                                         configure the JMX port
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0                                                            the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes                                               the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250                                                          the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                                                                        the JVM launch flags
[INFO]     [creator]         Using Java version 21 extracted from MANIFEST.MF
[INFO]     [creator]       BellSoft Liberica JRE 21.0.6: Contributing to layer
[INFO]     [creator]         Downloading from .0.6+10/bellsoft-jre21.0.6+10-linux-amd64.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[INFO]     [creator]         Adding 146 container CA certificates to JVM truststore
[INFO]     [creator]         Writing env.launch/BPI_APPLICATION_PATH.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CACERTS.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_CLASS_COUNT.default
[INFO]     [creator]         Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
[INFO]     [creator]         Writing env.launch/JAVA_HOME.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO]     [creator]         Writing env.launch/MALLOC_ARENA_MAX.default
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/java-opts
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jvm-heap
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/link-local-dns
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-configurer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jmx
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/jfr
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/openssl-certificate-loader
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-classpath-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/debug-9
[INFO]     [creator]         Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/nmt
[INFO]     [creator]       Java Security Properties: Contributing to layer
[INFO]     [creator]         Writing env.launch/JAVA_SECURITY_PROPERTIES.default
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO]     [creator]         Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Syft 2.10.0
[INFO]     [creator]       
[INFO]     [creator]         Downloading from .21.0/syft_1.21.0_linux_amd64.tar.gz
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Writing env.build/SYFT_CHECK_FOR_APP_UPDATE.default
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Executable JAR 6.13.0
[INFO]     [creator]       
[INFO]     [creator]       Class Path: Contributing to layer
[INFO]     [creator]         Writing env/CLASSPATH.delim
[INFO]     [creator]         Writing env/CLASSPATH.prepend
[INFO]     [creator]       Process types:
[INFO]     [creator]         executable-jar: java .springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]         task:           java .springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]         web:            java .springframework.boot.loader.launch.JarLauncher (direct)
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Spring Boot 5.33.0
[INFO]     [creator]       
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BPL_JVM_CDS_ENABLED                 false  whether to enable CDS optimizations at runtime
[INFO]     [creator]         $BPL_SPRING_AOT_ENABLED              false  whether to enable Spring AOT at runtime
[INFO]     [creator]         $BP_JVM_CDS_ENABLED                  false  whether to enable CDS & perform JVM training run
[INFO]     [creator]         $BP_SPRING_AOT_ENABLED               false  whether to enable Spring AOT
[INFO]     [creator]         $BP_SPRING_CLOUD_BINDINGS_DISABLED   false  whether to contribute Spring Boot cloud bindings support
[INFO]     [creator]         $BP_SPRING_CLOUD_BINDINGS_VERSION    1      default version of Spring Cloud Bindings library to contribute
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_SPRING_CLOUD_BINDINGS_DISABLED  false  whether to auto-configure Spring Boot environment properties from bindings
[INFO]     [creator]         $BPL_SPRING_CLOUD_BINDINGS_ENABLED   true   Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[INFO]     [creator]       Creating slices from layers index
[INFO]     [creator]         dependencies (83.8 MB)
[INFO]     [creator]         spring-boot-loader (459.3 KB)
[INFO]     [creator]         snapshot-dependencies (0.0 B)
[INFO]     [creator]         application (1.1 MB)
[INFO]     [creator]       Spring Cloud Bindings 2.0.4: Contributing to layer
[INFO]     [creator]         Downloading from .0.4/spring-cloud-bindings-2.0.4.jar
[INFO]     [creator]         Verifying checksum
[INFO]     [creator]         Copying to /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings
[INFO]     [creator]       Web Application Type: Contributing to layer
[INFO]     [creator]         Servlet web application detected
[INFO]     [creator]         Writing env.launch/BPL_JVM_THREAD_COUNT.default
[INFO]     [creator]       Launch Helper: Contributing to layer
[INFO]     [creator]         Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[INFO]     [creator]       4 application slices
[INFO]     [creator]       Image labels:
[INFO]     [creator]         .opencontainers.image.title
[INFO]     [creator]         .opencontainers.image.version
[INFO]     [creator]         .springframework.boot.version
[INFO]     [creator]     ===> EXPORTING
[INFO]     [creator]     Adding layer 'paketo-buildpacks/ca-certificates:helper'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/bellsoft-liberica:helper'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/bellsoft-liberica:jre'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/executable-jar:classpath'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/spring-boot:helper'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
[INFO]     [creator]     Adding layer 'paketo-buildpacks/spring-boot:web-application-type'
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:launch.sbom'
[INFO]     [creator]     Added 5/5 app layer(s)
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:launcher'
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:config'
[INFO]     [creator]     Adding layer 'buildpacksio/lifecycle:process-types'
[INFO]     [creator]     Adding label 'io.buildpacks.lifecycle.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.build.metadata'
[INFO]     [creator]     Adding label 'io.buildpacks.project.metadata'
[INFO]     [creator]     Adding label '.opencontainers.image.title'
[INFO]     [creator]     Adding label '.opencontainers.image.version'
[INFO]     [creator]     Adding label '.springframework.boot.version'
[INFO]     [creator]     Setting default process type 'web'
[INFO]     [creator]     Saving docker.io/***/my-image:1.1.0...
[INFO]     [creator]     ERROR: failed to export: saving image: failed to fetch base layers: saving image with ID "sha256:0c5ac79d549c4b077a7d857631f817f8b573f5da2c109a51f320ee584d44d3f2" from the docker daemon: Error response from daemon: unable to create manifests file: NotFound: content digest sha256:05cbce61634362ddc82e0d3ce86a6c812f0b2423070acecd8819c035ef8be68d: not found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.819 s
[INFO] Finished at: 2025-03-27T09:29:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal .springframework.boot:spring-boot-maven-plugin:3.4.4:build-image (default-cli) on project my-project: Execution default-cli of goal .springframework.boot:spring-boot-maven-plugin:3.4.4:build-image failed: Builder lifecycle 'creator' failed with status code 62 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] 

And this is what I have in my Docker

EDIT: According to this doc, the result is the same when I run the command directly using pack (outside of Spring Boot):

pack build --platform linux/amd64 --builder paketobuildpacks/builder-jammy-java-tiny:latest --path target/my-app-1.1.0-SNAPSHOT.jar my-project

Also, Rosetta seems to be activated on the computer:

lsbom -f /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom
./Library/Apple/usr/lib/libRosettaAot.dylib 100755  0/0 407280  3874584438
./Library/Apple/usr/libexec/oah/RosettaLinux/rosetta    100755  0/0 1726440 525538619
./Library/Apple/usr/libexec/oah/RosettaLinux/rosettad   100755  0/0 371016  2787156710
./Library/Apple/usr/libexec/oah/libRosettaRuntime   100755  0/0 464240  2138052629
./Library/Apple/usr/share/rosetta/rosetta   100644  0/0 64  1875722922

本文标签: