1. Resources
  2. /
  3. Examples
  4. /
  5. Rails Parallel Docker

Buildkite Rails Docker Parallel Pipeline Example

This repository is an example Buildkite pipeline that demonstrates how to run a large number of parallel test jobs for a Rails application using Docker and Knapsack.

See the full Getting Started Guide for step-by-step instructions on how to get this running.

Screenshot of Buildkite Rails Docker Parallel example pipeline

How it works

In the pipeline configuration file the parallelism property for the test step is set to 20. When a build, the step will appear 20 times in the pipeline, each with different environment variables exposed so you can divvy up your test suite accordingly. You can set the parallelism as high as you need to bring down your build times.

This example:

  • Uses Docker Compose to orchestrate the environment (Redis, Postgres, Memcached)
  • Runs tests in parallel across 20 containers using Buildkite’s parallelism feature
  • Leverages Knapsack for even test distribution
  • Is suitable for use with autoscaling environments like the Buildkite AWS Stack

Key files:

Parallel test execution

In pipeline.yml, the test step is configured with:

parallelism: 20

This causes the step to run 20 times in parallel. Each instance is exposed to environment variables like BUILDKITE_PARALLEL_JOB and BUILDKITE_PARALLEL_JOB_COUNT, which can be used to split the test suite dynamically.

Alternate setups

💡 Not using Docker? Try the Rails Parallel Example

💡 Want dynamic splitting/allocation? See the Knapsack Pro version

Further Reading

See the parallelizing builds guide for more information to create parallelized and distributed builds with Buildkite.

See the Containerized Builds with Docker guide for information on how to use Docker Compose with Buildkite pipelines.

Consult the Knapsack documentation for configuring your database and dependent services to support running parallel steps on the one machine.

License

See LICENSE.md (MIT)

More examples

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025