class_docstr: Dockerfile class.
  
  Dockerfile generates a default dockerfile if it does not exist.
  
  Attributes:
    filename: dockerfile filename.
    setup_py_filename: setup.py filename that defines the pipeline PIP package.
code: def __init__(
      self,
      filename: str,
      setup_py_filename: Optional[str] = None,
      base_image: Optional[str] = None,
  ):
      self.filename = filename
      if os.path.exists(self.filename):
          return
  
      if base_image is None and version.__version__.endswith(".dev"):
          raise ValueError(
              "Cannot find a base image automatically in development /"
              " nightly version. Please specify a base image using"
              " --build-base-image flag."
          )
  
      base_image = base_image or labels.BASE_IMAGE
      setup_py_filename = setup_py_filename or labels.SETUP_PY_FILENAME
      if os.path.exists(setup_py_filename):
          click.echo(
              "Generating Dockerfile with python package installation "
              "based on %s." % setup_py_filename
          )
          self._generate_default(
              _DEFAULT_DOCKERFILE_CONTENT_WITH_SETUP_PY
              % (base_image, setup_py_filename)
          )
          return
  
      click.echo(
          "No local %s, copying the directory and "
          "configuring the PYTHONPATH." % setup_py_filename
      )
      self._generate_default(
          _DEFAULT_DOCKERFILE_CONTENT_WITHOUT_SETUP_PY % base_image
      )
  
imports: import os
  from typing import Optional
  import click
  from tfx import version
  from tfx.tools.cli.container_builder import labels
label_desc: Use image node_id 1 to create a new Dockerfile object  with example: obj = Dockerfile(filename, setup_py_filename, base_image)