1
1
In this sample, you'll build a native GraalVM image for running web workloads in AWS Lambda.
2
2
3
3
4
- ## To build the sample on macOS (Apple silicon arm64)
4
+ ## To build the sample
5
5
6
6
You first need to build the function, then you will deploy it to AWS Lambda.
7
7
@@ -10,31 +10,21 @@ You first need to build the function, then you will deploy it to AWS Lambda.
10
10
Before starting the build, you must clone or download the code in ** pet-store-native** .
11
11
12
12
1 . Change into the project directory: ` samples/springboot3/pet-store-native `
13
- 2 . Run the following to build a Docker container image which will be used to create the Lambda function zip file.
13
+ 2 . Run the following to build a Docker container image which will include all the necessary dependencies to build the application
14
14
```
15
- docker build -t "al2 -graalvm21:native-web" .
15
+ docker build -t al2023 -graalvm21:native-web .
16
16
```
17
- 3 . Start the container
17
+ 3 . Build the application within the previously created build image
18
18
```
19
- docker run -dit -v `pwd`:`pwd` -w `pwd` -v ~/.m2:/root/.m2 al2 -graalvm21:native-web
19
+ docker run -it -v `pwd`:`pwd` -w `pwd` -v ~/.m2:/root/.m2 al2023 -graalvm21:native-web ./mvnw clean -Pnative package -DskipTests
20
20
```
21
- 4 . In Docker, open the image terminal.
22
-
23
- > Your working directory should default to the project root. Verify by running ` ls ` to view the files.
24
-
25
- 6 . From inside the container, build the Lambda function:
26
- ```
27
- ./mvnw clean -Pnative native:compile -DskipTests
28
- ```
29
-
30
- After the build finishes, you need to deploy the function.
31
- You can do it manually or you can use SAM (AWS Serverless Application Model) with the included template.yaml file.
32
- If you chose SAM simply execute the following command.
21
+ 4 . After the build finishes, you need to deploy the function:
33
22
```
34
23
sam deploy --guided
35
24
```
36
- This will deploy your application and will attach an AWS API Gateway
37
- Once the deployment is finished you shouild see the following:
25
+
26
+ This will deploy your application and will attach an AWS API Gateway
27
+ Once the deployment is finished you should see the following:
38
28
```
39
29
Key ServerlessWebNativeApi
40
30
Description URL for application
0 commit comments