Home

Awesome

Ruby Docker Container Images

Build Status Docker Pulls Docker Stars

Table of Contents

Docker Images

❗For better reliability we release images with stability tags (wodby/ruby:3-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.

About images:

Supported tags and respective Dockerfile links:

-dev

Images with -dev tag have the following additions:

-dev-macos

Same as -dev but the default user/group wodby has uid/gid 501/20 to match the macOS default user/group ids.

Supported architectures

All images built for linux/amd64, -dev-macos images additionally built for linux/arm64

Environment Variables

VariableDefault value
GIT_USER_EMAILwodby@example.com
GIT_USER_NAMEwodby
PUMA_DIRECTORY/usr/src/app
PUMA_ENVIRONMENTdevelopment
PUMA_PRELOAD_APP
PUMA_PRUNE_BUNDLER
PUMA_QUIET
PUMA_RACKUP/usr/src/app/config.ru
PUMA_TAG
PUMA_THREADS0, 16
PUMA_WORKER_BOOT_TIMEOUT60
PUMA_WORKER_TIMEOUT60
PUMA_WORKERS2
RAILS_ENVdevelopment
SSH_DISABLE_STRICT_KEY_CHECKING
SSH_PRIVATE_KEY
SSHD_GATEWAY_PORTSno
SSHD_HOST_KEYS_DIR/etc/ssh
SSHD_LOG_LEVELINFO
SSHD_PASSWORD_AUTHENTICATIONno
SSHD_PERMIT_USER_ENVno
SSHD_USE_DNSyes
UNICORN_CHECK_CLIENT_CONNECTIONfalse
UNICORN_DEBUG
UNICORN_PRELOAD_APPtrue
UNICORN_RUN_ONCEtrue
UNICORN_TIMEOUT30
UNICORN_WORKER_PROCESSES4
UNICORN_WORKING_DIRECTORY/usr/src/app

Build arguments

ArgumentDefault value
RUBY_DEV
WODBY_GROUP_ID1000
WODBY_USER_ID1000

Change WODBY_USER_ID and WODBY_GROUP_ID mainly for local dev version of images, if it matches with existing system user/group ids the latter will be deleted.

Changelog

Changes per stability tag reflected in git tags description under releases.

Gems

To install gems with native extensions use -dev image variants that contain required dev packages.

HTTP server

Puma

Puma is the default HTTP server, you can configure it via PUMA_ env vars.

Unicorn

To use Unicorn as your HTTP server override the default container command to /etc/init.d/unicorn. You can configure it via UNICORN_ env vars.

Crond

You can run Crond with this image changing the command to sudo -E crond -f -d 0 and mounting a crontab file to ./crontab:/etc/crontabs/wodby. Example crontab file contents:

# min	hour	day	month	weekday	command
*/1	*	*	*	*	echo "test" > /mnt/files/cron

SSHD

You can run SSHD with this image by changing the command to sudo /usr/sbin/sshd -De and mounting authorized public keys to /home/wodby/.ssh/authorized_keys

Adding SSH key

You can add a private SSH key to the container by mounting it to /home/wodby/.ssh/id_rsa

Complete Ruby stack

See https://github.com/wodby/docker4ruby

Orchestration Actions

Usage:

make COMMAND [params ...]

commands:
    check-ready [host max_try wait_seconds delay_seconds]
    files-import source
    files-link public_dir