code: def _create_work_container(self) -> None:
      # 1. Get work container.
      source_path = os.path.join(
          _PROJECT_ROOT, "dockers/Dockerfile.jinja"
      )
      destination_path = os.path.join(_PROJECT_ROOT, "Dockerfile")
      work_destination_path = os.path.join(_PROJECT_ROOT, "work.p")
  
      # 2. Pickle the work.
      with open(work_destination_path, "wb") as f:
          pickle.dump(self.work, f)
  
      # 3. Load Lightning requirements.
      with open(source_path) as f:
          template = jinja2.Template(f.read())
  
      # Get the work local build spec.
      requirements = self.work.local_build_config.requirements
  
      # Render template with the requirements.
      dockerfile_str = template.render(
          requirements=" ".join(requirements),
          redis_host="host.docker.internal"
          if sys.platform == "darwin"
          else "127.0.0.1",
      )
  
      with open(destination_path, "w") as f:
          f.write(dockerfile_str)
  
      # 4. Build the container.
      self.image = f"work-{self.work.__class__.__qualname__.lower()}"
      os.system(f"docker build . --tag {self.image}")
  
      # 5. Clean the leftover files.
      os.remove(destination_path)
      os.remove(work_destination_path)
  
file_path: pytorch-lightning/src/lightning/app/utilities/packaging/docker.py
imports: import os
  import pickle
  import shutil
  import sys
  from datetime import datetime
  from typing import Optional
  from lightning.app import _PROJECT_ROOT, LightningWork
  from lightning.app.storage.path import _shared_local_mount_path
  from lightning.app.utilities.imports import _is_docker_available, _is_jinja2_available, requires
label_desc: Use image node_id 3 for calling the DockerRunner obj's underlying member method code with example usage: obj._create_work_container() without return types