Skip to content

Commit ea8c3a4

Browse files
author
Rick Frankel
committed
Update docs (copied from dockerhub)
1 parent f8bd29b commit ea8c3a4

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1-
# alpine-ruby
1+
# `alpine-ruby`: Minimal Ruby image
22

3-
This is a simple Dockerfile which will create a base ruby image build on [Alpine Linux](https://www.alpinelinux.org) version 3.2, and its packaged ruby (currently v2.2.3).
3+
This is a *VERY* small mri ruby 2.2.3 image. It uses the [Alpine Linux](https://www.alpinelinux.org) ruby packages, and has `bundler` and minimal ruby packages installed.
4+
5+
## Using this package
6+
7+
``` Dockerfile
8+
FROM cybercode/alpine-ruby:2.2
9+
CMD["/mycommand"]
10+
```
11+
12+
Unlike the [Official Ruby Image](https://hub.docker.com/_/ruby/) or [tinycore-ruby](https://hub.docker.com/r/tatsushid/tinycore-ruby/), it does not create any users or do `ONBUILD` magic and the `CMD` defaults to `irb`.
13+
14+
### Using C-based gems
15+
16+
This image does not contain a compiler, etc. The best way to install C-based gems is to install the compiler chain and any development libraries required, run bundle install and remove the libraries all in one `RUN` command. That way the the final image will stay small.
17+
18+
For example, if you are using the `pg` and `nokogiri` gems:
19+
20+
``` Dockerfile
21+
BUILD_DEPS="build-dependencies build-base ruby-dev libc-dev linux-headers \
22+
openssl-dev postgresql-dev libxml2-dev libxslt-dev"
23+
RUN apk --update add --virtual $BUILD_DEPS && \
24+
sudo -iu app bundle config build.nokogiri --use-system-libraries && \
25+
sudo -iu app bundle install --path vendor/bundle && \
26+
apk del $BUILD_DEPS && unset BUILD_DEPS
27+
```

0 commit comments

Comments
 (0)