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
> A ⚡ [Serverless framework](https://www.serverless.com/) ⚡ plugin for [Rustlang](https://www.rust-lang.org/en-US/) applications 🦀
4
+
> A ⚡ [Serverless framework](https://www.serverless.com/framework/docs/) ⚡ plugin for [Rustlang](https://www.rust-lang.org/) applications 🦀
5
5
6
6
## 📦 Install
7
7
@@ -39,7 +39,7 @@ functions:
39
39
method: GET
40
40
```
41
41
42
-
> 💡 The Rust Lambda runtime requires a binary named `bootstrap`. This plugin renames the binary cargo builds to `bootstrap` for you before packaging. You do **not** need to do this manually in your Cargo configuration.
42
+
> 💡 The Rust Lambda runtime requires a binary named `bootstrap`. This plugin renames the binary cargo builds to `bootstrap` for you before packaging. You do **not** need to do this manually in your Cargo.toml configuration file.
43
43
44
44
## 🖍️ customize
45
45
@@ -57,11 +57,51 @@ custom:
57
57
dockerTag: 'some-custom-tag'
58
58
# custom docker image
59
59
dockerImage: 'dockerUser/dockerRepo'
60
+
```
61
+
62
+
### 🥼 (experimental) local builds
63
+
64
+
While it's useful to have a build environment match your deployment
65
+
environment dockerized builds do come with some notable tradeoffs.
66
+
The external dependency on docker itself often causes friction in an added dependency to your build. If you wish to build lambda's locally, this plugin also supports an experimental `dockerless` mode.
67
+
68
+
```diff
69
+
custom:
70
+
# this section allows for customization of the default
71
+
# serverless-rust plugin settings
72
+
rust:
73
+
# flags passed to cargo
74
+
cargoFlags: '--features enable-awesome'
60
75
# experimental! when set to true, artifacts are built locally outside of docker
61
-
dockerless: true
76
+
+ dockerless: true
62
77
```
63
78
64
-
> Note. `dockerless` mode is experimental. Windows and OSX will both have to install a separate target with `rustup target add x86_64-unknown-linux-musl`
79
+
This will build and link your lambda as a static binary that can be deployed in to the lambda execution environment as a static binary using [MUSL](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html).
80
+
81
+
In order to use this mode its expected that you install the `x86_64-unknown-linux-musl` target on all platforms locally with
82
+
83
+
```sh
84
+
$ rustup target add x86_64-unknown-linux-musl
85
+
```
86
+
87
+
On linux platforms, you will need to install musl-tools
On Mac OSX, you will need to install a MUSL cross compilation toolchain
94
+
95
+
```sh
96
+
$ brew install filosottile/musl-cross/musl-cross
97
+
```
98
+
99
+
Using MUSL comes with some other notable tradeoffs. One of which is complications that arise when depending on dynamically linked dependencies.
100
+
101
+
* With OpenSSL bindings which you can safely replace is with [rustls](https://github.com/ctz/rustls) or [vendor it](https://docs.rs/openssl/0.10.29/openssl/#vendored)
102
+
* Other known issues have been reported with [backtrace](https://github.com/KodrAus/rust-cross-compile#limitations).
103
+
104
+
If you find other MUSL specific issues, please reported them by [opening an issue](https://github.com/softprops/serverless-rust/issues/new?template=bug_report.md).
0 commit comments