Skip to content

Commit 611694c

Browse files
committed
Update template to Ruby 3.3.6 and watchdog
The image had to move from a base slim image, to one which also includes build-essential due to the new requirement by Sinatra to require native gems. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 88772d4 commit 611694c

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
## ruby-http
22

3+
This template uses [Sinatra internally](https://sinatrarb.com/intro.html), and the slim Docker image for Ruby to keep the image small. A native build toolchain is installed, which still results in a smaller image than the standard Ruby image on the Docker Hub.
4+
5+
Ruby version: 3.3.6.
6+
37
### Usage:
48

5-
```
6-
faas template pull https://github.com/openfaas-incubator/ruby-http
9+
```bash
10+
faas template pull https://github.com/openfaas/ruby-http
711
faas new --lang ruby-http homepage
812
```
913

template/ruby-http/Dockerfile

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
FROM openfaas/of-watchdog:0.8.1 as watchdog
2-
3-
FROM ruby:2.7.2-slim-buster
1+
FROM ghcr.io/openfaas/of-watchdog:0.10.6 as watchdog
2+
3+
FROM ruby:3.3.6-slim
4+
5+
# AE: This step can take a few moments, however the resulting image
6+
# is half the size of the non-slim image
7+
RUN apt-get update && apt-get install -qqy \
8+
build-essential \
9+
libssl-dev \
10+
libffi-dev \
11+
zlib1g-dev \
12+
&& rm -rf /var/lib/apt/lists/*
413

514
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
615
RUN chmod +x /usr/bin/fwatchdog

template/ruby-http/Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
source 'https://rubygems.org'
22

3+
gem "nio4r"
34
gem "sinatra"
5+
gem "rackup"
6+
gem "puma"

0 commit comments

Comments
 (0)