code: def singularity2docker(self, runscript="/bin/bash", force=False):
      '''convert a Singularity recipe to a (best estimated) Dockerfile'''
  
      recipe = [ "FROM %s" %self.fromHeader ]
  
      # Comments go up front!
      recipe += self.comments  
  
      # First add files, labels
      recipe += write_lines('ADD', self.files)
      recipe += write_lines('LABEL', self.labels)
      recipe += write_lines('ENV', self.environ)
  
      # Install routine is added as RUN commands
      recipe += write_lines('RUN', self.install)
  
      # Take preference for user, entrypoint, command, then default
      runscript = self._create_runscript(runscript, force)
      recipe.append('CMD %s' %runscript)
  
      if self.test is not None:
          recipe.append(write_lines('HEALTHCHECK', self.test))
  
      # Clean up extra white spaces
      return '\n'.join(recipe).replace('\n\n','\n'f singularity2docker(self, runscript="/bin/bash", force=False):
      '''convert a Singularity recipe to a (best estimated) Dockerfile'''
  
      recipe = [ "FROM %s" %self.fromHeader ]
  
      # Comments go up front!
      recipe += self.comments  
  
      # First add files, labels
      recipe += write_lines('ADD', self.files)
      recipe += write_lines('LABEL', self.labels)
      recipe += write_lines('ENV', self.environ)
  
      # Install routine is added as RUN commands
      recipe += write_lines('RUN', self.install)
  
      # Take preference for user, entrypoint, command, then default
      runscript = self._create_runscript(runscript, force)
      recipe.append('CMD %s' %runscript)
  
      if self.test is not None:
          recipe.append(write_lines('HEALTHCHECK', self.test))
  
      # Clean up extra white spaces
      return '\n'.join(recipe).replace('\n\n','\n')
docs: convert a Singularity recipe to a (best estimated) Dockerfile