code: def emit_containers(self, containers, verbose=True):
          
          containers = sorted(containers, key=lambda c: c.get('name'))
  
          output = {
              'kind': 'Deployment',
              'apiVersion': 'extensions/v1beta1',
              'metadata': {
                  'name': None,
                  'namespace': 'default',
                  'labels': {
                      'app': None,
                      'version': 'latest',
                  },
              },
              'spec': {
                  'replicas': 1,
                  'selector': {
                      'matchLabels': {
                          'app': None,
                          'version': 'latest'
                      }
                  },
                  'template': {
                      'metadata': {
                          'labels': {
                              'app': None,
                              'version': 'latest'
                          }
                      },
                      'spec': {
                          'containers': json.loads(json.dumps(containers))
                      }
                  }
              }
          }
          if self.volumes:
              volumes = sorted(self.volumes.values(), key=lambda x: x.get('name'))
              output['spec']['template']['spec']['volumes'] = volumes
  
          noalias_dumper = yaml.dumper.SafeDumper
          noalias_dumper.ignore_aliases = lambda self, data: True
          return yaml.dump(
              output,
              default_flow_style=False,
              Dumper=noalias_dumper
          )
docs: Emits the applications and sorts containers by name
  
          :param containers: List of the container definitions
          :type containers: list of dict
  
          :param verbose: Print out newlines and indented JSON
          :type verbose: bool
  
          :returns: The text output
          :rtype: str