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 ↗

buildkit/build_llb/build_env.go

buildkit/build_llb/build_env.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
package build_llb import (	"maps"	"slices") type BuildEnvironment struct {	PathList []string	EnvVars  map[string]string} func NewGraphEnvironment() BuildEnvironment {	return BuildEnvironment{		PathList: make([]string, 0),		EnvVars:  make(map[string]string),	}} // Merges the other environment into the current environmentfunc (e *BuildEnvironment) Merge(other BuildEnvironment) {	e.PathList = appendUniquePaths(e.PathList, other.PathList...)	maps.Copy(e.EnvVars, other.EnvVars)} func appendUniquePaths(existing []string, additions ...string) []string {	// Steps with shared ancestors inherit the same paths, so merging their outputs can	// otherwise duplicate entries in downstream steps and the final image PATH. Keep	// the first occurrence to preserve path precedence.	for _, path := range additions {		if slices.Contains(existing, path) {			continue		}		existing = append(existing, path)	}	return existing} func (e *BuildEnvironment) PushPath(path string) {	if slices.Contains(e.PathList, path) {		return	}	e.PathList = append([]string{path}, e.PathList...)} func (e *BuildEnvironment) AddEnvVar(key, value string) {	e.EnvVars[key] = value}