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/install_bin_builder.go

core/generate/install_bin_builder.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
// Unlike the mise step builder, this builder uses mise to install a binary, but throws away all of the mise installation cruft// this reduces the image size considerably. Image sizes are important: performance is a feature and smaller images perform better.// They are easier to move around, debug, use less storage, etc. This is why we have this step in use on particular high-volume build paths. // TODO this builder is not exposed to the user right now via railpack.json package generate import (	"fmt" 	"github.com/railwayapp/railpack/core/plan"	"github.com/railwayapp/railpack/core/resolver") const (	BinDir = "/railpack") type InstallBinStepBuilder struct {	DisplayName           string	Resolver              *resolver.Resolver	SupportingAptPackages []string	Package               resolver.PackageRef} func (c *GenerateContext) NewInstallBinStepBuilder(name string) *InstallBinStepBuilder {	step := &InstallBinStepBuilder{		DisplayName: c.GetStepName(name),		Resolver:    c.Resolver,		Package:     resolver.PackageRef{},	} 	c.Steps = append(c.Steps, step) 	return step} func (b *InstallBinStepBuilder) Name() string {	return b.DisplayName} func (b *InstallBinStepBuilder) Default(name string, defaultVersion string) resolver.PackageRef {	b.Package = b.Resolver.Default(name, defaultVersion)	return b.Package} func (b *InstallBinStepBuilder) GetOutputPaths() []string {	return []string{b.getBinPath()}} func (b *InstallBinStepBuilder) Version(name resolver.PackageRef, version string, source string) {	b.Resolver.Version(name, version, source)} func (b *InstallBinStepBuilder) GetLayer() plan.Layer {	return plan.NewStepLayer(b.Name(), plan.Filter{		Include: b.GetOutputPaths(),	})} func (b *InstallBinStepBuilder) Build(p *plan.BuildPlan, options *BuildStepOptions) error {	packageVersion := options.ResolvedPackages[b.Package.Name].ResolvedVersion	if packageVersion == nil {		return fmt.Errorf("package %s not found", b.Package.Name)	} 	step := plan.NewStep(b.DisplayName)	step.Secrets = []string{}	// take a look at mise_step_builder for any config that would be useful here	step.Variables = map[string]string{		// Enforces HTTPS and stricter security		"MISE_PARANOID": "1",	}	step.Inputs = []plan.Layer{		plan.NewImageLayer(RailpackBuilderImage),	} 	// TODO copy MISE_VERBOSE from the environment if it's set 	binPath := b.getBinPath() 	step.AddCommands([]plan.Command{		plan.NewExecCommand(fmt.Sprintf("mise install-into %s@%s %s", b.Package.Name, *packageVersion, binPath)),		plan.NewPathCommand(binPath),		plan.NewPathCommand(fmt.Sprintf("%s/bin", binPath)),	}) 	p.Steps = append(p.Steps, *step) 	return nil} func (b *InstallBinStepBuilder) getBinPath() string {	return fmt.Sprintf("%s/%s", BinDir, b.Package.Name)}