-   Notifications  You must be signed in to change notification settings 
- Fork 949
Description
Describe the bug
I have a Spring Boot application. The app uses 'software.amazon.awssdk' and 'software.amazon.awssdk.crt' to upload directories on S3.
 Here is the S3 configuration:
 @Bean public S3Client s3Client() { return S3Client.builder() .region(Region.of(s3Region)) .credentialsProvider(EnvironmentVariableCredentialsProvider.create()) .build(); } @Bean public S3TransferManager s3AsyncClient() { S3AsyncClient s3AsyncClient = S3AsyncClient.crtBuilder() .credentialsProvider(EnvironmentVariableCredentialsProvider.create()) .region(Region.of(s3Region)) .targetThroughputInGbps(20.0) .minimumPartSizeInBytes(8 * MB) .build(); return S3TransferManager.builder() .s3Client(s3AsyncClient) .build(); } Here is the docker file:
# First stage: complete build environment FROM maven:3.9.1-eclipse-temurin-17 AS builder # Copy pom.xml and source code COPY src/ src/ COPY pom.xml . # package jar RUN mvn clean install # Second stage: minimal runtime environment FROM eclipse-temurin:17-jdk-alpine # copy jar from the first stage COPY --from=builder target/*.jar app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "app.jar"] Expected Behavior
Everything works well when I run the app on my local JVM.
Current Behavior
However, when I run the created image from eclipse-temurin:17-jdk-alpine I see the following error:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [software.amazon.awssdk.transfer.s3.S3TransferManager]: Factory method 's3AsyncClient' threw exception with message: /tmp/AWSCRT_875725296750 5452721libaws-crt-jni.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/AWSCRT_8757252967505452721libaws-crt-jni.so) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.10.jar!/:6.0.10] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-6.0.10.jar!/:6.0.10] ... 83 common frames omitted Caused by: java.lang.UnsatisfiedLinkError: /tmp/AWSCRT_8757252967505452721libaws-crt-jni.so: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/AWSCRT_8757252967505452721libaws-crt-jni.s Reproduction Steps
I used Amazon's amazoncorretto:17 image, and the app started with no issue. But when I use eclipse-temurin:17-jdk-alpine I get into trouble.
 I'm not sure what the /tmp/AWSCRT_8757252967505452721libaws-crt-jni.so: is and how to fix it.
Possible Solution
No response
Additional Information/Context
My machine is Windows 10 -with an I7 Intel processor. Got the same problem when I tried to run the image on the cloud using Kubernetes.
AWS Java SDK version used
2.20.93
JDK version used
17
Operating System and version
No issue with Windows 10 - Intel I7 processor / amazoncorretto:17 image -
 Have problem with eclipse-temurin:17-jdk-alpine