Skip to content
Jeremy Echols edited this page Jan 31, 2024 · 5 revisions

Running RAIS from Docker

Demo

If you are just looking to run a quick demo, see our Docker Demo guide.

Choosing your image

Make sure you use the best image (docker image, not JP2 image) for your needs, or build your own if you need to modify code, change plugins, etc.

Fedora

This is the default image when you pull uolibraries/rais from Docker hub. It includes the ImageMagick processing plugin (so image sources can be JPG, PNG, TIFF, and GIF) as well as the other standard plugins.

However, it's a very large image and many plugins will not be necessary for most users. For a "just give me the damn thing" kind of setup, this one is perfect and will not require tweaking, but if you want to have a more focused (or lightweight) RAIS, this isn't the best choice.

Alpine

The Alpine image is extremely small: under twenty megabytes. It doesn't have any plugins by default, but its size makes it perfect for quickly grabbing it and running, and the recipe is a great starting point for building a custom image that's targeted to your precise needs.

Custom images

Speaking of custom images: while the Docker images available on dockerhub. should suffice for most use cases, you can easily build your own. Simply clone the repository, modify docker/Dockerfile or (more likely) docker/Dockerfile-alpine, and run make docker. Your new docker images will be known as uolibraries/rais:latest-indev and uolibraries/rais:latest-alpine.

The barebones nature of the Alpine image makes it a great starting point.

Running

Once you've chosen or built an image, running RAIS is trivial. All settings are explained in rais-example.toml.

Use the environment variables or command-line flags, or else mount a custom configuration file inside the container at /etc/rais.toml.

Make sure you mount in an images volume if you're using the filesystem for your image sources!

# Use the example config and fire up the 3.x alpine image:
docker run --rm \
  -v "$(pwd)/docker/images":/var/local/images \
  -v "$(pwd)/rais-example.toml":/etc/rais.toml \
  uolibraries/rais:4-alpine

# Use environment variables to override parts of the config file so you only
# set up the tracer plugin and avoid all the others:
docker run --rm \
  -v "$(pwd)/docker/images":/var/local/images \
  -v "$(pwd)/rais-example.toml":/etc/rais.toml \
  -e "RAIS_PLUGINS=json-tracer.so" \
  -e "RAIS_TRACEROUT=/tmp/trace.json" \
  -e "RAIS_TRACERFLUSHSECONDS=90" \
  uolibraries/rais:4