Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 17 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ The Ruby Runtime Interface Client package currently supports ruby 3.0 and above.

If you're upgrading from 2.x, update your Dockerfile to use the `_HANDLER` environment variable instead of relying on `CMD` arguments.

## Supported Base Operating Systems

The Ruby Runtime Interface Client supports the following Linux distributions:

- **Amazon Linux 2023**
- **Alpine**
- **Debian**
- **Ubuntu**

For Alpine, Debian, and Ubuntu, we support the latest LTS release and the previous LTS release for 6 months after a new LTS version has been released.

## Usage

### Creating a Docker Image for Lambda with the Runtime Interface Client
First step is to choose the base image to be used. The supported Linux OS distributions are:

- Amazon Linux 2023
- Amazon Linux 2
- Alpine
- Debian
- Ubuntu
First step is to choose the base image to be used.

In order to install the Runtime Interface Client, either add this line to your application's Gemfile:

Expand All @@ -56,30 +61,13 @@ set the `_HANDLER` environment variable to specify the desired handler.

Example Dockerfile:
```dockerfile
FROM amazonlinux:latest

# Define custom function directory
ARG FUNCTION_DIR="/function"

# Install ruby
RUN dnf install -y ruby3.2 make

# Install bundler
RUN gem install bundler

# Install the Runtime Interface Client
RUN gem install aws_lambda_ric

# Copy function code
RUN mkdir -p ${FUNCTION_DIR}
COPY app.rb ${FUNCTION_DIR}

WORKDIR ${FUNCTION_DIR}
FROM public.ecr.aws/lambda/ruby:3.4

# Set the handler via environment variable
ENV _HANDLER="app.App::Handler.process"
# Add your handler definition
ADD test/integration/test-handlers/echo/app.rb .

ENTRYPOINT ["/usr/local/bin/aws_lambda_ric"]
# Specify your handler
CMD ["app.App::Handler.process"]
```

Note that the `ENTRYPOINT` may differ based on the base image used. You can find the correct path by running an
Expand Down
Loading