code: def write_to_bento(
      self, bento_fs: FS, build_ctx: str, conda: CondaOptions
  ) -> None:
      docker_folder = fs.path.combine("env", "docker")
      bento_fs.makedirs(docker_folder, recreate=True)
      dockerfile_path = fs.path.combine(docker_folder, "Dockerfile")
  
      # NOTE that by default the generated Dockerfile won't have BuildKit syntax.
      # By default, BentoML containerization will use BuildKit. To opt-out specify DOCKER_BUILDKIT=0
      bento_fs.writetext(
          dockerfile_path,
          generate_containerfile(
              self,
              build_ctx,
              conda=conda,
              bento_fs=bento_fs,
              enable_buildkit=False,
          ),
      )
      copy_file_to_fs_folder(
          fs.path.join(
              os.path.dirname(os.path.dirname(__file__)),
              "container",
              "frontend",
              "dockerfile",
              "entrypoint.sh",
          ),
          bento_fs,
          docker_folder,
      )
  
      if self.setup_script:
          try:
              setup_script = resolve_user_filepath(
                  self.setup_script, build_ctx
              )
          except FileNotFoundError as e:
              raise InvalidArgument(
                  f"Invalid setup_script file: {e}"
              ) from None
          if not os.access(setup_script, os.X_OK):
              message = f"{setup_script} is not executable."
              if not psutil.WINDOWS:
                  raise InvalidArgument(
                      f"{message} Ensure the script has a shebang line, then run 'chmod +x {setup_script}'."
                  ) from None
              raise InvalidArgument(message) from None
          copy_file_to_fs_folder(
              setup_script, bento_fs, docker_folder, "setup_script"
          )
  
      # If dockerfile_template is provided, then we copy it to the Bento
      # This template then can be used later to containerize.
      if self.dockerfile_template is not None:
          copy_file_to_fs_folder(
              resolve_user_filepath(
                  self.dockerfile_template, build_ctx
              ),
              bento_fs,
              docker_folder,
              "Dockerfile.template",
          )
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import subprocess
  import sys
  import typing
  from shlex import quote
  from sys import version_info
  import attr
  import fs
  import fs.copy
  import psutil
  import yaml
  from pathspec import PathSpec
  from ...exceptions import BentoMLException
  from ...exceptions import InvalidArgument
  from ..configuration import BENTOML_VERSION
  from ..configuration import clean_bentoml_version
  from ..configuration import get_quiet_mode
  from ..container import generate_containerfile
  from ..container.frontend.dockerfile import ALLOWED_CUDA_VERSION_ARGS
  from ..container.frontend.dockerfile import CONTAINER_SUPPORTED_DISTROS
  from ..container.frontend.dockerfile import SUPPORTED_CUDA_VERSIONS
  from ..container.frontend.dockerfile import DistroSpec
  from ..container.frontend.dockerfile import get_supported_spec
  from ..container.generate import BENTO_PATH
  from ..utils import bentoml_cattr
  from ..utils import copy_file_to_fs_folder
  from ..utils import resolve_user_filepath
  from ..utils.dotenv import parse_dotenv
  from .build_dev_bentoml_whl import build_bentoml_editable_wheel
label_desc: Use image node_id 3 for calling the DockerOptions obj's underlying member method code with example usage: obj.write_to_bento(bento_fs, build_ctx, conda) without return types