You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-16
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,30 @@
2
2
3
3
## 🤔 about
4
4
5
-
This image extends [lambda ci `provided`](https://github.com/lambci/docker-lambda#documentation) builder docker image, a faithful reproduction of the actual AWS provided lambda runtime environment,
5
+
This image extends [lambda ci `provided`](https://github.com/lambci/docker-lambda#documentation) builder docker image, a faithful reproduction of the actual AWS "**provided**" Lambda runtime environment,
6
6
and installs [rustup](https://rustup.rs/) and the *stable* rust toolchain.
7
7
8
8
## 📦 install
9
9
10
-
Tags for this docker follow the convention `softprops/lambda-rust:{version}-rust-{rust-stable-version}'
11
-
Where rust-version is a stable version of rust.
10
+
Tags for this docker image follow the naming convention `softprops/lambda-rust:{version}-rust-{rust-stable-version}`
11
+
where `{rust-stable-version}` is a stable version of rust.
12
12
13
13
You can find a list of available docker tags [here](https://hub.docker.com/r/softprops/lambda-rust/)
14
14
15
+
> 💡 If you don't find the version you're looking for, please open a new github issue to publish one
16
+
15
17
You can also depend directly on `softprops/lambda-rust:latest` for the most recently published version.
16
18
17
19
## 🤸 usage
18
20
19
-
The default docker entrypoint will build a release optimized version your rust artifact under `target/lambda/release` to
21
+
The default docker entrypoint will build a packaged release optimized version your Rust artifact under `target/lambda/release` to
20
22
isolate the lambda specific build artifacts from your host-local build artifacts.
21
23
22
24
You will want to volume mount `/code` to the directory containing your cargo project.
23
25
24
-
You can pass additional flags to cargo by setting the `CARGO_FLAGS` docker env variable
25
-
26
-
A typical docker run might look like the following
26
+
You can pass additional flags to `cargo`, the Rust build tool, by setting the `CARGO_FLAGS` docker env variable
27
27
28
-
> 💡 the -v (volume mount) flags for `/root/.cargo/{registry,git}` are optional but when supplied, provides a much faster turn around when doing iterative development
28
+
A typical docker run might look like the following.
29
29
30
30
```bash
31
31
$ docker run --rm \
@@ -35,27 +35,29 @@ $ docker run --rm \
35
35
softprops/lambda-rust
36
36
```
37
37
38
+
> 💡 The -v (volume mount) flags for `/root/.cargo/{registry,git}` are optional but when supplied, provides a much faster turn around when doing iterative development
39
+
38
40
## 🔬 local testing
39
41
40
-
Once you've build a Rust lambda function artifact the `provided` runtime expects
41
-
deployments of that artifact to be named "**bootstrap**". The lambda-rust docker image
42
-
builds a zip file, named after the binary, containing your binary files renamed to bootstrap
42
+
Once you've built a Rust lambda function artifact, the `provided` runtime expects
43
+
deployments of that artifact to be named "**bootstrap**". The `lambda-rust` docker image
44
+
builds a zip file, named after the binary, containing your binary files renamed to "bootstrap"
43
45
44
-
You can invoke this bootstap executable with the lambda-ci provided docker image.
46
+
You can invoke this bootstap executable with the lambda-ci docker image for the `provided` AWS lambda runtime.
45
47
46
48
```sh
47
49
# start a docker container replicating the "provided" lambda runtime
48
50
# awaiting an event to be provided via stdin
49
51
$ unzip \
50
-
target/lambda/release/{your-binary-name}.zip \
51
-
-d /tmp/lambda && \
52
-
docker run \
52
+
target/lambda/release/{your-binary-name}.zip \
53
+
-d /tmp/lambda && \
54
+
docker run \
53
55
-i -e DOCKER_LAMBDA_USE_STDIN=1 \
54
56
--rm \
55
57
-v /tmp/lambda:/var/task \
56
58
lambci/lambda:provided
57
59
58
-
# provide payload via stdin (typically a json blob)
60
+
# provide an event payload via stdin (typically a json blob)
0 commit comments