frontend.go 967 B

123456789101112131415161718192021222324252627282930
  1. package frontend
  2. import (
  3. "context"
  4. "io"
  5. "github.com/moby/buildkit/cache"
  6. "github.com/moby/buildkit/executor"
  7. "github.com/moby/buildkit/solver"
  8. "github.com/moby/buildkit/solver/pb"
  9. digest "github.com/opencontainers/go-digest"
  10. specs "github.com/opencontainers/image-spec/specs-go/v1"
  11. )
  12. type Frontend interface {
  13. Solve(ctx context.Context, llb FrontendLLBBridge, opt map[string]string) (solver.CachedResult, map[string][]byte, error)
  14. }
  15. type FrontendLLBBridge interface {
  16. Solve(ctx context.Context, req SolveRequest) (solver.CachedResult, map[string][]byte, error)
  17. ResolveImageConfig(ctx context.Context, ref string, platform *specs.Platform) (digest.Digest, []byte, error)
  18. Exec(ctx context.Context, meta executor.Meta, rootfs cache.ImmutableRef, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error
  19. }
  20. type SolveRequest struct {
  21. Definition *pb.Definition
  22. Frontend string
  23. FrontendOpt map[string]string
  24. ImportCacheRefs []string
  25. }