def _copy_dir_entry(workdir: str, user_id: int, user_group: int,
                    dirname: str) -> str:
  """Returns the Dockerfile entry necessary to copy a single extra subdirectory
  from the current directory into a docker container during build.

  """
  owner = "{}:{}".format(user_id, user_group)
  return """# Copy {dirname} into the Docker container.
COPY --chown={owner} {dirname} {workdir}/{dirname}
""".format_map({
      "owner": owner,
      "workdir": workdir,
      "dirname": dirname
  })