diff --git a/client/llb/definition.go b/client/llb/definition.go index 14486dc088535..cdd320897cc5f 100644 --- a/client/llb/definition.go +++ b/client/llb/definition.go @@ -29,9 +29,11 @@ type DefinitionOp struct { inputCache *sync.Map // shared and written among DefinitionOps so avoid race on this map using sync.Map } +var empty = &pb.Definition{} + // NewDefinitionOp returns a new operation from a marshalled definition. func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) { - if def == nil { + if def == nil || proto.Equal(def, empty) { return nil, errors.New("invalid nil input definition to definition op") }