code: func New(client docker.Client, config *api.Config, fs fs.FileSystem, scripts build.ScriptsHandler, overrides build.Overrides) (*Layered, error) {
  	excludePattern, err := regexp.Compile(config.ExcludeRegExp)
  	if err != nil {
  		return nil, err
  	}
  
  	d := docker.New(client, config.PullAuthentication)
  	tarHandler := tar.New(fs)
  	tarHandler.SetExclusionPattern(excludePattern)
  
  	return &Layered{
  		docker:  d,
  		config:  config,
  		fs:      fs,
  		tar:     tarHandler,
  		scripts: scripts,
  	}, nil
  }
docs: // New creates a Layered builder.