Skip to content

Commit

Permalink
Add documentation on how to switch amazonlinux image for lambdas (#809)
Browse files Browse the repository at this point in the history
As discussed in #799 we will document how to change this.
  • Loading branch information
timyates authored Aug 29, 2023
1 parent e32f468 commit adaa678
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,8 @@ The advantage of allowing your dependencies to be dictated by the runtime is tha
If you are interested in deploying your Micronaut application to AWS Lambda using GraalVM, you only need to set the runtime to `lambda` and execute `./gradlew buildNativeLambda`.
This task will generate a GraalVM native executable inside a Docker container, and create the file `build/libs/your-app.zip` file ready to be deployed to AWS Lambda using a custom runtime. See more information in {aws-docs}[Micronaut AWS documentation].

===== Architecture considerations

The plugin will detect the host operating system architecture (based on the `os.arch` Java system property) and will install the corresponding GraalVM binary distribution inside the Docker image.
This means that when running packaging from an X86_64 (Intel/AMD) machine, the produced native executable will be an `amd64` binary, whilst on an ARM host (such as the new Mac M1) it will be an `aarch64` binary.

Expand All @@ -1054,6 +1056,19 @@ dockerfileNative {
}
----

===== Base image and pull limits

By default, the plugin will use amazonlinux pulled from Docker Hub as a base image for GraalVM native AWS Lambda executables.
If you wish to switch to using a different base image (for example to use your own Docker repository or to use Amazon's public repository), you can configure the `baseImage` property in a `dockerfileNative` configuration block in your build:

[source, groovy]
----
dockerfileNative {
// Use the image from the Amazon ECR Public Gallery
baseImage.set("public.ecr.aws/amazonlinux/amazonlinux:2")
}
----

=== Packaging the application

By default the plugin doesn't create a runnable fatjar when running `./gradlew assemble`.
Expand Down

0 comments on commit adaa678

Please sign in to comment.