Skip to content

Commit c4dff70

Browse files
committed
Adapted dependencies & rebuild GraalVM
1 parent 52f44c8 commit c4dff70

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

labs/unicorn-store/software/alternatives/unicorn-store-spring-native-graalvm/Dockerfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM public.ecr.aws/amazonlinux/amazonlinux:2
22

3+
#Install depencencies
34
RUN yum -y update \
4-
&& yum install -y unzip tar gzip bzip2-devel ed gcc gcc-c++ gcc-gfortran \
5+
&& yum install -y unzip zip tar gzip bzip2-devel ed gcc gcc-c++ gcc-gfortran \
56
less libcurl-devel openssl openssl-devel readline-devel xz-devel \
67
zlib-devel glibc-static libcxx libcxx-devel llvm-toolset-7 zlib-static \
78
&& rm -rf /var/cache/yum
@@ -30,9 +31,20 @@ RUN ln -s /usr/lib/maven/bin/mvn /usr/bin/mvn
3031

3132
ENV JAVA_HOME /usr/lib/graalvm
3233

33-
#Build Native Image
34+
#Copy pom.xml to image & cache Maven dependencies
3435
WORKDIR project
3536
COPY pom.xml pom.xml
3637
RUN mvn verify clean --fail-never -B
38+
39+
#Copy project and build native image
3740
COPY src src
38-
RUN mvn -Pnative -DskipTests package
41+
RUN mvn -Pnative -DskipTests package
42+
43+
#Copy bootstrap file (needed for AWS Lambda custom runtime) to image, set file permissions and bundle as zip
44+
WORKDIR target
45+
COPY bootstrap bootstrap
46+
RUN chmod +x unicorn-store-spring-native
47+
RUN chmod +x bootstrap
48+
RUN zip lambda-spring-native unicorn-store-spring-native bootstrap
49+
50+

labs/unicorn-store/software/alternatives/unicorn-store-spring-native-graalvm/build-native-image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm lambda-spring-native.zip
88
docker build . -t graalvm-lambda-builder --progress=plain
99

1010
#Extract the resulting native image
11-
docker run --rm --entrypoint cat graalvm-lambda-builder target/unicorn-store-spring-native > unicorn-store-spring-native
11+
docker run --rm --entrypoint cat graalvm-lambda-builder lambda-spring-native.zip > lambda-spring-native.zip
12+
1213

13-
zip lambda-spring-native unicorn-store-spring-native bootstrap
1414

Binary file not shown.

0 commit comments

Comments
 (0)