code: def compatible_options_group(f: F[t.Any]):
      import click
      from click_option_group import optgroup
  
      optgroup_option = partial(compatible_option, factory=optgroup)
  
      compat = [
          optgroup_option(
              "--add-host",
              equivalent=("opt", "add-host=host:ip"),
              multiple=True,
              metavar="[HOST:IP,]",
              help="Add a custom host-to-IP mapping.",
          ),
          optgroup_option(
              "--build-arg",
              equivalent=("opt", "build-arg=FOO=bar"),
              multiple=True,
              metavar="[KEY=VALUE,]",
              help="Set build-time variables.",
          ),
          optgroup_option(
              "--cache-from",
              equivalent=("opt", "cache-from=user/app:cache"),
              multiple=True,
              default=None,
              metavar="[NAME|type=TYPE[,KEY=VALUE]]",
              help="External cache sources (e.g.: ``type=local,src=path/to/dir``).",
          ),
          optgroup_option(
              "--iidfile",
              type=click.STRING,
              equivalent=("opt", "iidfile=/path/to/file"),
              default=None,
              metavar="PATH",
              help="Write the image ID to the file.",
          ),
          optgroup_option(
              "--label",
              equivalent=("opt", "label=io.container.capabilities=baz"),
              multiple=True,
              metavar="[NAME|[KEY=VALUE],]",
              help="Set metadata for an image. This is equivalent to LABEL in given Dockerfile.",
          ),
          optgroup_option(
              "--network",
              type=click.STRING,
              equivalent=("opt", "network=default"),
              metavar="default|VALUE",
              default=None,
              help="Set the networking mode for the ``RUN`` instructions during build (default ``default``).",
          ),
          optgroup_option(
              "--no-cache",
              equivalent=("opt", "no-cache"),
              is_flag=True,
              default=False,
              help="Do not use cache when building the image.",
          ),
          optgroup_option(
              "--output",
              equivalent=("opt", "output=type=local,dest=/path/to/dir"),
              multiple=True,
              default=None,
              metavar="[PATH,-,type=TYPE[,KEY=VALUE]",
              help="Output destination.",
          ),
          optgroup_option(
              "--platform",
              equivalent=("opt", "platform=linux/amd64,linux/arm/v7"),
              default=None,
              metavar="VALUE[,VALUE]",
              multiple=True,
              type=click.STRING,
              help="Set target platform for build.",
          ),
          optgroup_option(
              "--progress",
              equivalent=("opt", "progress=auto"),
              default=None,
              type=click.Choice(["auto", "tty", "plain"]),
              metavar="VALUE",
              help="Set type of progress output. Use plain to show container output.",
          ),
          optgroup_option(
              "--pull",
              equivalent=("opt", "pull"),
              is_flag=True,
              default=False,
              help="Always attempt to pull all referenced images.",
          ),
          optgroup_option(
              "--secret",
              multiple=True,
              equivalent=(
                  "opt",
                  "secret=id=aws,src=$HOME/.aws/crendentials",
              ),
              metavar="[type=TYPE[,KEY=VALUE]",
              default=None,
              help="Secret to expose to the build.",
          ),
          optgroup_option(
              "--ssh",
              type=click.STRING,
              equivalent=("opt", "ssh=default=$SSH_AUTH_SOCK"),
              metavar="default|<id>[=<socket>|<key>[,<key>]]",
              default=None,
              help="SSH agent socket or keys to expose to the build. See https://docs.docker.com/engine/reference/commandline/buildx_build/#ssh",
          ),
          optgroup_option(
              "--target",
              equivalent=("opt", "target=release-stage"),
              metavar="VALUE",
              type=click.STRING,
              default=None,
              help="Set the target build stage to build.",
          ),
      ]
      for options in reversed(compat):
          f = options(f)
      return f
  
file_path: BentoML/src/bentoml_cli/containerize.py
imports: from __future__ import annotations
  import itertools
  import logging
  import shutil
  import subprocess
  import sys
  import tempfile
  import typing
  from functools import partial
label_desc: Use image node_id 2 for calling a global function with example usage: compatible_options_group(f) and returns: f