diff --git a/.nvmrc b/.nvmrc index 2831228..b6a7d89 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.17.1 +16 diff --git a/README.md b/README.md index bb212a8..860ae6b 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,12 @@ A ZIO-based AWS Custom Runtime compatible with GraalVM Native Image. ## Installation ```scala -libraryDependencies += "dev.zio" %% "zio-lambda" % "1.0.3" +libraryDependencies += "dev.zio" %% "zio-json" % "0.6.2" +libraryDependencies += "dev.zio" %% "zio-lambda" % "1.0.4" // Optional dependencies -libraryDependencies += "dev.zio" %% "zio-lambda-event" % "1.0.3" -libraryDependencies += "dev.zio" %% "zio-lambda-response" % "1.0.3" +libraryDependencies += "dev.zio" %% "zio-lambda-event" % "1.0.4" +libraryDependencies += "dev.zio" %% "zio-lambda-response" % "1.0.4" ``` ## Usage @@ -52,7 +53,7 @@ Each release will contain a zip file ready to be used as a lambda layer) and you 1. Create an AWS Lambda function and choose the runtime where you provide your own bootstrap on Amazon Linux 2 ![create-lambda](https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png) -2. Run `sbt graalvm-native-image:packageBin`, we'll find the binary present under the `graalvm-native-image` folder: +2. Run `sbt GraalVMNativeImage/packageBin`, we'll find the binary present under the `graalvm-native-image` folder: ![binary-located](https://user-images.githubusercontent.com/14280155/164103337-6645dfeb-7fc4-4f7f-9b13-8005b0cddead.png) @@ -88,7 +89,7 @@ Following the steps from `Direct deployment of native image binary` to produce y up the native binary into a Docker image and deploy it like that to AWS Lambda. ```Dockerfile -FROM gcr.io/distroless/base +FROM gcr.io/distroless/base-debian12 COPY lambda-example/target/graalvm-native-image/zio-lambda-example /app/zio-lambda-example CMD ["/app/zio-lambda-example"] ``` diff --git a/build.sbt b/build.sbt index 32f4c40..a190bfd 100644 --- a/build.sbt +++ b/build.sbt @@ -94,18 +94,15 @@ lazy val zioLambdaExample = module("zio-lambda-example", "lambda-example") stdSettings("zio-lambda-example"), assembly / assemblyJarName := "zio-lambda-example.jar", GraalVMNativeImage / mainClass := Some("zio.lambda.example.SimpleHandler"), - GraalVMNativeImage / containerBuildImage := GraalVMNativeImagePlugin - .generateContainerBuildImage( - "hseeberger/scala-sbt:graalvm-ce-21.3.0-java17_1.6.2_3.1.1" - ) - .value, + GraalVMNativeImage / containerBuildImage := Some("ghcr.io/graalvm/native-image-community:21.0.2"), graalVMNativeImageOptions := Seq( "--verbose", "--no-fallback", "--install-exit-handlers", "--enable-http", - "--allow-incomplete-classpath", + "--link-at-build-time", "--report-unsupported-elements-at-runtime", + "-H:+UnlockExperimentalVMOptions", "-H:+StaticExecutableWithDynamicLibC", "-H:+RemoveSaturatedTypeFlows" ) diff --git a/docs/index.md b/docs/index.md index 9ab1e54..53afab3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,6 +11,7 @@ A ZIO-based AWS Custom Runtime compatible with GraalVM Native Image. ## Installation ```scala +libraryDependencies += "dev.zio" %% "zio-json" % "0.6.2" libraryDependencies += "dev.zio" %% "zio-lambda" % "@VERSION@" // Optional dependencies @@ -52,7 +53,7 @@ Each release will contain a zip file ready to be used as a lambda layer) and you 1. Create an AWS Lambda function and choose the runtime where you provide your own bootstrap on Amazon Linux 2 ![create-lambda](https://user-images.githubusercontent.com/14280155/164102664-3686e415-20be-4dd9-8979-ea6098a7a4b9.png) -2. Run `sbt graalvm-native-image:packageBin`, we'll find the binary present under the `graalvm-native-image` folder: +2. Run `sbt GraalVMNativeImage/packageBin`, we'll find the binary present under the `graalvm-native-image` folder: ![binary-located](https://user-images.githubusercontent.com/14280155/164103337-6645dfeb-7fc4-4f7f-9b13-8005b0cddead.png) @@ -88,7 +89,7 @@ Following the steps from `Direct deployment of native image binary` to produce y up the native binary into a Docker image and deploy it like that to AWS Lambda. ```Dockerfile -FROM gcr.io/distroless/base +FROM gcr.io/distroless/base-debian12 COPY lambda-example/target/graalvm-native-image/zio-lambda-example /app/zio-lambda-example CMD ["/app/zio-lambda-example"] ```