Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Docker

Docker is the easiest option to implement instances, to get started, make sure you have Docker installed on the host machine.

When creating a Docker challenge, you can select a container image from the list of images available on your machine. You'll also need to write a challenge Lua script, where you're expected to set raya.docker_options and specify at least the container's port. When an instance is requested, a new container is launched with an ephemeral port assigned automatically.

Raya communicates with the docker daemon using the unix socket unix:///var/run/docker.sock.

If you are running Raya inside a container, make sure to have the socket mounted as a volume. Check this example

Limitations

While Docker works well for most scenarios, you might want to consider using Kubernetes if:

  • You need high availability and can't tolerate a single point of failure (The Docker implementation is limited to a single host).
  • Your challenges are resource-intensive or you have too many challenges for a single host to handle.
  • You want to assign a dynamic subdomain for each instance instead of exposing Docker's ephemeral ports.

    Subdomains can be implemented with Docker if you use a reverse proxy on the host machine and configure it dynamically via your Lua script. However, Kubernetes makes this process much more straightforward.