executor.go 708 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package executor
  2. import (
  3. "context"
  4. "io"
  5. "net"
  6. "github.com/moby/buildkit/cache"
  7. "github.com/moby/buildkit/solver/pb"
  8. )
  9. type Meta struct {
  10. Args []string
  11. Env []string
  12. User string
  13. Cwd string
  14. Tty bool
  15. ReadonlyRootFS bool
  16. ExtraHosts []HostIP
  17. NetMode pb.NetMode
  18. SecurityMode pb.SecurityMode
  19. }
  20. type Mount struct {
  21. Src cache.Mountable
  22. Selector string
  23. Dest string
  24. Readonly bool
  25. }
  26. type Executor interface {
  27. // TODO: add stdout/err
  28. Exec(ctx context.Context, meta Meta, rootfs cache.Mountable, mounts []Mount, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error
  29. }
  30. type HostIP struct {
  31. Host string
  32. IP net.IP
  33. }