OOrchard

Devfile

Orchard supports the Devfile specification as an alternative to devcontainers. If your repository contains a devfile.yaml, Orchard can use it to define the development environment inside each grove.

How It Works

When you plant a grove with --spec devfile (or when no devcontainer.json is present), Orchard:

  1. Discovers devfile.yaml in your repository (devfile.yaml, devfile.yml, .devfile.yaml, or .devfile.yml)
  2. Provisions a VM (seedling) with Docker installed
  3. Parses the Devfile and maps container components to seeds
  4. Starts the containers and runs lifecycle commands

Discovery Order

Orchard searches for Devfile in this order:

  1. devfile.yaml
  2. devfile.yml
  3. .devfile.yaml
  4. .devfile.yml

What's Supported

Schema Version

Devfile schema version 2.x is supported.

Container Components

Orchard maps Devfile containerComponents to grove seeds:

Devfile FieldOrchard Mapping
imageContainer image
nameComponent name
env[]Container environment variables
endpoints[].targetPortForwarded ports
memoryLimit / memoryRequestMemory limits
cpuLimit / cpuRequestCPU limits

Lifecycle Commands

Orchard supports exec-type lifecycle commands via Devfile events:

EventWhen It Runs
preStartOver SSH on the seedling host, before containers start
postStartVia docker exec inside the container, after it starts

Multiple command IDs for a single event are composed into a sequential shell line with &&.

Example devfile.yaml:

code
schemaVersion: 2.2.0
metadata:
  name: my-project
components:
  - name: app
    container:
      image: node:20
      endpoints:
        - name: app
          targetPort: 3000
      env:
        - name: NODE_ENV
          value: development
commands:
  - id: install
    exec:
      component: app
      commandLine: npm install
      group:
        kind: build
  - id: start-app
    exec:
      component: app
      commandLine: npm start
      group:
        kind: run
events:
  postStart:
    - install

What's Not Supported

  • kubernetes / openshift component types (tracked in orchard#86)
  • apply / composite command types

Precedence

When a repository contains both devcontainer.json and devfile.yaml, Orchard prefers devcontainer.json by default. Override with --spec:

code
# Force devfile spec
trowel grove plant https://github.com/your-org/your-repo --spec devfile

Next Steps