Skip to content

Commit 70f880f

Browse files
authored
Merge pull request #9 from aws-samples/dev
update README for ARM support
2 parents 0d2a28f + cc9a728 commit 70f880f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ $ make build
4141
Once the build completes, it creates two docker images:
4242
- "aws-lambda-adapter:latest-x86_64" for x86_64.
4343
- "aws-lambda-adapter:latest-aarch64" for arm64.
44+
4445
AWS Lambda Adapter binary is packaged as '/opt/bootstrap' inside each docker image. "aws-lambda-adapter:latest" is tagged to the same image as "aws-lambda-adapter:latest-x86_64".
4546

4647
### Compiling on macOS
4748

4849
If you want to install rust toolchain in your Macbook and play with the source code, you can follow the steps below.
49-
First, install [rustup](https://rustup.rs/) if you haven't done it already. Then, add the `x86_64-unknown-linux-musl` target:
50+
First, install [rustup](https://rustup.rs/) if you haven't done it already. Then, add targets for x86_86 and arm64:
5051

5152
```shell
5253
$ rustup target add x86_64-unknown-linux-musl
54+
$ rustup target add aarch64-unknown-linux-musl
5355
```
5456

5557
And we have to install macOS cross-compiler toolchains. `messense/homebrew-macos-cross-toolchains` can be used on both Intel chip and Apple M1 chip.
@@ -60,7 +62,7 @@ $ brew install x86_64-unknown-linux-musl
6062
$ brew install aarch64-unknown-linux-musl
6163
```
6264

63-
And we need to inform Cargo that our project uses the newly-installed linker when building for the `x86_64-unknown-linux-musl` platform.
65+
And we need to inform Cargo that our project uses the newly-installed linker when building for the `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl` platforms.
6466
Create a new directory called `.cargo` in your project folder and a new file called `config` inside the new folder.
6567

6668
```shell
@@ -82,7 +84,7 @@ $ CC=aarch64-unknown-linux-musl-gcc cargo build --release --target=aarch64-unkno
8284
Lambda Adapter binary for x86_64 will be placed at `target/x86_64-unknown-linux-musl/release/bootstrap`.
8385
Lambda Adapter binary for arm64 will be placed at `target/aarch64-unknown-linux-musl/release/bootstrap`.
8486

85-
Finally, run the following command to package lambda adapter into a docker image named "aws-lambda-adapter:latest".
87+
Finally, run the following command to package lambda adapter into two container images for x86_64 and arm64.
8688

8789
```shell
8890
$ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
@@ -91,6 +93,12 @@ $ docker build -f Dockerfile.mac --build-arg ARCH=aarch64 -t aws-lambda-adapter:
9193
$ docker tag aws-lambda-adapter:latest-x86_64 aws-lambda-adapter:latest
9294
```
9395

96+
When these commands complete successfully, you will have the following container images.
97+
98+
- "aws-lambda-adapter:latest-x86_64" for x86_64.
99+
- "aws-lambda-adapter:latest-aarch64" for arm64.
100+
- "aws-lambda-adapter:latest" is the same as "aws-lambda-adapter:latest-x86_64".
101+
94102
## How to use it?
95103

96104
To use it, copy the bootstrap binary to your container, and use it as ENTRYPOINT.

0 commit comments

Comments
 (0)