code: def mktar_from_dockerfile(fileobject: BinaryIO) -> IO:
      
  
      f = tempfile.NamedTemporaryFile()
      t = tarfile.open(mode="w:gz", fileobj=f)
  
      if isinstance(fileobject, BytesIO):
          dfinfo = tarfile.TarInfo("Dockerfile")
          dfinfo.size = len(fileobject.getvalue())
          fileobject.seek(0)
      else:
          dfinfo = t.gettarinfo(fileobj=fileobject, arcname="Dockerfile")
  
      t.addfile(dfinfo, fileobject)
      t.close()
      f.seek(0)
      return f
docs: Create a zipped tar archive from a Dockerfile
      **Remember to close the file object**
      Args:
          fileobj: a Dockerfile
      Returns:
          a NamedTemporaryFile() object