Skip to content

Commit a285fed

Browse files
committed
Update README [ci skip]
1 parent 7edb2dd commit a285fed

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,22 @@ The lambda payload is unwrapped as named arguments to the R function to call, e.
215215

216216
The lambda function returns whatever is returned by the R function as a JSON object with `result` as a root element.
217217

218+
### Building custom layers
219+
218220
In order to install additional R packages, you can create a lambda layer containing the libraries, just as in the second example.
219221
You must use the the compiled package files.
220222
The easiest way is to install the package with `install.packages()` and copy the resulting folder in `$R_LIBS`.
221223
Using only the package sources does not suffice.
222224
The file structure must be `R/library/<my-library>`.
223-
See `awspack/compile.sh` for an example.
224225
If your package requires system libraries, place them in `R/lib/`.
225226

227+
You can use Docker for building your layer.
228+
You need to run `./docker_build.sh` first.
229+
Then you can install your packages inside the container and copy the files to your machine.
230+
See `awspack/` for an example.
231+
The `build.sh` script is used to run the docker container and copy sources to your machine.
232+
The `entrypoint.sh` script is used for installing packages inside the container.
233+
226234
## Limitations
227235

228236
AWS Lambda is limited to running with 3GB RAM and must finish within 15 minutes.

0 commit comments

Comments
 (0)