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: CHANGELOG.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,16 @@
1
1
# ⚡ 0.4.0 (unreleased)
2
2
3
-
* bump [lambda-rust](https://hub.docker.com/r/softprops/lambda-rust/) docker version to `0.2.6-rust-1.43.0`
3
+
* experimental dockerless mode! To enable local builds add the following to your `serverless.yml` file
4
+
5
+
```yml
6
+
custom:
7
+
rust:
8
+
dockerless: true
9
+
```
10
+
11
+
This comes with some new expectations about your local environment. Please see the readme section on local builds for more information.
12
+
13
+
* bump [lambda-rust](https://hub.docker.com/r/softprops/lambda-rust/) docker version to `0.2.7-rust-1.43.1`
4
14
* The docker image used to build artifacts is now configurable though the `custom.rust.dockerImage` `serverless.yml` config setting. The default remains `softprops/lambda-rust` [#65](https://github.com/softprops/serverless-rust/pull/65)
5
15
* The docker cli is now configurable via `SLS_DOCKER_CLI` environment variable. The default is the first `docker` that resolves on your operating system's path. [#61](https://github.com/softprops/serverless-rust/pull/61)
> 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
@@ -55,8 +55,57 @@ custom:
55
55
cargoFlags: '--features enable-awesome'
56
56
# custom docker tag
57
57
dockerTag: 'some-custom-tag'
58
+
# custom docker image
59
+
dockerImage: 'dockerUser/dockerRepo'
58
60
```
59
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
+
67
+
The external dependency on docker itself often causes friction as an added dependency to your build. Depending on the docker image limited which versions of rust you could deploy with. The docker image tracked stable rust. Some users might wish to try unstable versions early. Local builds enable that.
68
+
69
+
If you wish to build lambda's locally, this plugin also supports an experimental `dockerless` mode.
70
+
71
+
```diff
72
+
custom:
73
+
# this section allows for customization of the default
74
+
# serverless-rust plugin settings
75
+
rust:
76
+
# flags passed to cargo
77
+
cargoFlags: '--features enable-awesome'
78
+
# experimental! when set to true, artifacts are built locally outside of docker
79
+
+ dockerless: true
80
+
```
81
+
82
+
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).
83
+
84
+
In order to use this mode its expected that you install the `x86_64-unknown-linux-musl` target on all platforms locally with
85
+
86
+
```sh
87
+
$ rustup target add x86_64-unknown-linux-musl
88
+
```
89
+
90
+
On linux platforms, you will need to install musl-tools
On Mac OSX, you will need to install a MUSL cross compilation toolchain
97
+
98
+
```sh
99
+
$ brew install filosottile/musl-cross/musl-cross
100
+
```
101
+
102
+
Using MUSL comes with some other notable tradeoffs. One of which is complications that arise when depending on dynamically linked dependencies.
103
+
104
+
* 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)
105
+
* Other limitations are noted [here](https://github.com/KodrAus/rust-cross-compile#limitations).
106
+
107
+
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).
108
+
60
109
### 🎨 Per function customization
61
110
62
111
If your serverless project contains multiple functions, you may sometimes
0 commit comments