mantiserve.tasks.docker_util module

This module provides docker utility facilities.

NOTE: This is located separately because Docker tries to load libssl that may not be present within a specific Docker image/container itself.

mantiserve.tasks.docker_util.run_task_in_docker(image_name: str, container_name: str, command: List[str], working_dir: str, memory_limit: Optional[Mebibytes] = None) bytes

Run a command in a Docker container set up for Mantiserve tasks.

Parameters
  • image_name – The image name to use for a container

  • container_name – The container name to run

  • command – The command to run within the container

  • working_dir – The working directory within the container

  • memory_limit – An optional memory cap to apply to the container

  • image_name (str) –

  • container_name (str) –

  • command (List[str]) –

  • working_dir (str) –

  • memory_limit (Optional[Mebibytes]) –

Returns

Docker logs

Return type

bytes