code: def add_writable_file_volume(self,
                                   runtime,          # type: List[Text]
                                   volume,           # type: MapperEnt
                                   host_outdir_tgt,  # type: Optional[Text]
                                   tmpdir_prefix     # type: Text
                                  ):  # type: (...) -> None
          
          if self.inplace_update:
              self.append_volume(runtime, volume.resolved, volume.target,
                                 writable=True)
          else:
              if host_outdir_tgt:
                  # shortcut, just copy to the output directory
                  # which is already going to be mounted
                  if not os.path.exists(os.path.dirname(host_outdir_tgt)):
                      os.makedirs(os.path.dirname(host_outdir_tgt))
                  shutil.copy(volume.resolved, host_outdir_tgt)
              else:
                  tmp_dir, tmp_prefix = os.path.split(tmpdir_prefix)
                  tmpdir = tempfile.mkdtemp(prefix=tmp_prefix, dir=tmp_dir)
                  file_copy = os.path.join(
                      tmpdir, os.path.basename(volume.resolved))
                  shutil.copy(volume.resolved, file_copy)
                  self.append_volume(runtime, file_copy, volume.target,
                                     writable=True)
              ensure_writable(host_outdir_tgt or file_copy)
docs: Append a writable file mapping to the runtime option list.