code: def image_from_docker_args(args):
      
      bool_args = ["-t", "--tty", "--rm","--privileged", "--oom-kill-disable","--no-healthcheck", "-i",
          "--interactive", "--init", "--help", "--detach", "-d", "--sig-proxy", "-it", "-itd"]
      last_flag = -2
      last_arg = ""
      possible_images = []
      if len(args) > 0 and args[0] == "run":
          args.pop(0)
      for i, arg in enumerate(args):
          if arg.startswith("-"):
              last_flag = i
              last_arg = arg
          elif "@sha256:" in arg:
              # Because our regex doesn't match digests
              possible_images.append(arg)
          elif docker_image_regex(arg):
              if last_flag == i - 2:
                  possible_images.append(arg)
              elif "=" in last_arg:
                  possible_images.append(arg)
              elif last_arg in bool_args and last_flag == i - 1:
                  possible_images.append(arg)
      most_likely = None
      for img in possible_images:
          if ":" in img or "@" in img or "/" in img:
              most_likely = img
              break
      if most_likely == None and len(possible_images) > 0:
          most_likely = possible_images[0]
      return most_likely
docs: This scans docker run args and attempts to find the most likely docker image argument.
      If excludes any argments that start with a dash, and the argument after it if it isn't a boolean
      switch.  This can be improved, we currently fallback gracefully when this fails.