package dockerfile import ( "fmt" "github.com/alexei/tinyforge/internal/workload/plugin" ) // idShort is the first 8 chars of the workload ID. Same shape as the // static plugin — workload names are not UNIQUE in the schema, the ID // short suffix is what keeps two same-named workloads from clobbering // each other's container/image artifacts. func idShort(w plugin.Workload) string { if len(w.ID) < 8 { return w.ID } return w.ID[:8] } // containerNameFor is the deterministic container name. Prefix `tf-build-` // distinguishes a dockerfile-built container from `dw-site-` (static) and // per-stage image names at a glance in `docker ps`. func containerNameFor(w plugin.Workload) string { return fmt.Sprintf("tf-build-%s-%s", w.Name, idShort(w)) } // imageTagFor is the deterministic image tag the build step emits. Same // shape as the container name so `docker images` shows the linkage at a // glance. func imageTagFor(w plugin.Workload) string { return fmt.Sprintf("tf-build-%s-%s:latest", w.Name, idShort(w)) }