---
name: "Ruby Docker"
description: "Runs Ruby tests using Docker."
author: "buildkite"
repo: "ruby-docker-example"
stars: 9
demo: "https://buildkite.com/buildkite/ruby-docker-example/builds/latest?branch=main"
---

# Buildkite Ruby Docker Example


This repository is an example [Buildkite](https://buildkite.com/) pipeline that demonstrates how to test a [Ruby](https://www.ruby-lang.org/en/) project using [Docker](https://docker.com/).



See the full [Getting Started Guide](https://buildkite.com/docs/guides/getting-started) for step-by-step instructions on how to get this running.


<a href="https://buildkite.com/buildkite/ruby-docker-example/builds/latest?branch=main">
  <img width="2400" alt="Screenshot of example pipeline build page" src="https://raw.githubusercontent.com/buildkite/ruby-docker-example/main/.buildkite/screenshot.png" />
</a>

<!-- docs:start -->

## How it works

This example:
- Uses the [Ruby Docker image](https://hub.docker.com/_/ruby/)
- Defines a [Docker Compose](https://docs.docker.com/compose/) service to run tests
- Uses a simple RSpec test suite for demonstration

Key files:
- [`Dockerfile`](https://github.com/buildkite/ruby-docker-example/blob/HEAD/Dockerfile) – defines the Ruby environment
- [`docker-compose.yml`](https://github.com/buildkite/ruby-docker-example/blob/HEAD/docker-compose.yml) – defines the app service
- [`pipeline.yml`](https://github.com/buildkite/ruby-docker-example/blob/HEAD/.buildkite/pipeline.yml) – uploads the pipeline

<!-- docs:end -->

## License

See [LICENSE.md](https://github.com/buildkite/ruby-docker-example/blob/HEAD/LICENSE.md) (MIT)