code: func newEmpire(db *empire.DB, c *Context) (*empire.Empire, error) {
  	docker, err := newDockerClient(c)
  	if err != nil {
  		return nil, err
  	}
  
  	scheduler, err := newScheduler(db, c)
  	if err != nil {
  		return nil, err
  	}
  
  	logs, err := newLogsStreamer(c)
  	if err != nil {
  		return nil, err
  	}
  
  	streams, err := newEventStreams(c)
  	if err != nil {
  		return nil, err
  	}
  
  	runRecorder, err := newRunRecorder(c)
  	if err != nil {
  		return nil, err
  	}
  
  	reg, err := newRegistry(docker, c)
  	if err != nil {
  		return nil, err
  	}
  
  	e := empire.New(db)
  	e.Scheduler = scheduler
  	e.EventStream = empire.AsyncEvents(streams)
  	e.ImageRegistry = reg
  	e.Environment = c.String(FlagEnvironment)
  	e.RunRecorder = runRecorder
  	e.MessagesRequired = c.Bool(FlagMessagesRequired)
  
  	switch c.String(FlagAllowedCommands) {
  	case "procfile":
  		e.AllowedCommands = empire.AllowCommandProcfile
  	default:
  	}
  
  	if logs != nil {
  		e.LogsStreamer = logs
  	}
  
  	return e, nil
  }
docs: // Empire ===============================