File tree Expand file tree Collapse file tree
labs/unicorn-store/software/alternatives/unicorn-store-spring-native-graalvm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM public.ecr.aws/amazonlinux/amazonlinux:2
22
3+ # Install depencencies
34RUN 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
3132ENV JAVA_HOME /usr/lib/graalvm
3233
33- # Build Native Image
34+ # Copy pom.xml to image & cache Maven dependencies
3435WORKDIR project
3536COPY pom.xml pom.xml
3637RUN mvn verify clean --fail-never -B
38+
39+ # Copy project and build native image
3740COPY 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+
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ rm lambda-spring-native.zip
88docker 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
You can’t perform that action at this time.
0 commit comments