---
name: "Jenkinsfile"
description: "Run a Jenkinsfile on Buildkite using Jenkinsfile Runner"
author: "buildkite"
repo: "jenkinsfile-example"
stars: 0
demo: "https://buildkite.com/buildkite/jenkinsfile-example"
---

# Run Jenkinsfile on Buildkite


Use [Jenkinsfile Runner][jenkinsfile-runner] to run a [Jenkinsfile](https://github.com/buildkite/jenkinsfile-example/blob/HEAD/jenkinsfile) on a [Buildkite Agent][buildkite-agent].

This repository is checked out by the Buildkite Agent. It then runs the Jenkinsfile using Jenkinsfile Runner via [a Docker image][jenkinsfile-runner-image], using the [Docker Buildkite Plugin][docker-buildkite-plugin], with the checkout mounted inside.

This example is basic, but illustrates the idea - anything the Jenkinsfile might need could be added to an image atop the Jenkinsfile Runner. [Jenkinsfile Runner Image Packs][jenkinsfile-runner-image-packs] provide some existing examples.

  [jenkinsfile]: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/
  [jenkinsfile-runner]: https://github.com/jenkinsci/jenkinsfile-runner
  [buildkite-agent]: https://buildkite.com/docs/agent
  [jenkinsfile-runner-image]: https://hub.docker.com/r/jenkins/jenkinsfile-runner
  [docker-buildkite-plugin]: https://github.com/buildkite-plugins/docker-buildkite-plugin
  [jenkinsfile-runner-image-packs]: https://github.com/jenkinsci/jenkinsfile-runner-image-packs

Try it yourself:


<a href="https://buildkite.com/buildkite/jenkinsfile-example/builds/latest?branch=main"><img width="1504" alt="Screenshot of Jenksfile example pipeline" src="https://raw.githubusercontent.com/buildkite/jenkinsfile-example/main/.buildkite/screenshot.png" /></a>