railpack

Configure and troubleshoot Railpack builds, with emphasis on RAILPACK_* environment variables, railpack.json overlays, build-plan inspection, local CLI installation and usage, and local BuildKit containers. Use for Railpack provider configuration, custom install/build/start commands, Mise or Apt packages, build or runtime variables and secrets, generated-plan debugging, BUILDKIT_HOST errors, or running Railpack from a release or source checkout.

Install
npx skills add 'https://github.com/railwayapp/railpack/tree/main/.'
Incomplete bundle · no download
main · 21a254fScanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗

core/generate/deploy_builder.go

core/generate/deploy_builder.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
package generate import (	"github.com/railwayapp/railpack/core/plan") type DeployBuilder struct {	Base         plan.Layer	DeployInputs []plan.Layer	StartCmd     string	Variables    map[string]string	Paths        []string	AptPackages  []string} func NewDeployBuilder() *DeployBuilder {	return &DeployBuilder{		Base:         plan.NewImageLayer(plan.RailpackRuntimeImage),		DeployInputs: []plan.Layer{},		StartCmd:     "",		Variables:    map[string]string{},		Paths:        []string{},		AptPackages:  []string{},	}} func (b *DeployBuilder) SetInputs(layers []plan.Layer) {	b.DeployInputs = layers} func (b *DeployBuilder) AddInputs(layers []plan.Layer) {	b.DeployInputs = append(b.DeployInputs, layers...)} func (b *DeployBuilder) HasIncludeForStep(stepName string, path string) bool {	for _, layer := range b.DeployInputs {		if layer.Step != stepName {			continue		}		for _, inc := range layer.Include {			// exact match, or existing include is "." which covers everything			if inc == path || inc == "." {				return true			}		}	}	return false} // checks if any of the deploy inputs contain a given step namefunc (b *DeployBuilder) HasInputForStep(stepName string) bool {	for _, layer := range b.DeployInputs {		if layer.Step == stepName {			return true		}	}	return false} func (b *DeployBuilder) AddAptPackages(packages []string) {	b.AptPackages = append(b.AptPackages, packages...)} func (b *DeployBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions) {	baseLayer := b.Base 	if len(b.AptPackages) > 0 {		runtimeAptStep := plan.NewStep("packages:apt:runtime")		runtimeAptStep.Inputs = []plan.Layer{baseLayer}		runtimeAptStep.AddCommands([]plan.Command{			options.NewAptInstallCommand(b.AptPackages),		})		runtimeAptStep.Caches = options.Caches.GetAptCaches()		runtimeAptStep.Secrets = []string{}		p.Steps = append(p.Steps, *runtimeAptStep)		baseLayer = plan.NewStepLayer(runtimeAptStep.Name)	} 	p.Deploy.Base = baseLayer 	p.Deploy.Inputs = append(p.Deploy.Inputs, b.DeployInputs...)	p.Deploy.StartCmd = b.StartCmd	p.Deploy.Variables = b.Variables	p.Deploy.Paths = b.Paths}