vagd.detect =========== .. py:module:: vagd.detect Attributes ---------- .. autoapisummary:: vagd.detect._FROM vagd.detect._ARG vagd.detect._VAR vagd.detect._UBUNTU_RELEASE vagd.detect._COMPILER vagd.detect._UBUNTU_GCC vagd.detect._DEBIAN_GCC Functions --------- .. autoapisummary:: vagd.detect.image_from_dockerfile vagd.detect.image_from_comment vagd.detect.detect_image Module Contents --------------- .. py:data:: _FROM .. py:data:: _ARG .. py:data:: _VAR .. py:data:: _UBUNTU_RELEASE .. py:data:: _COMPILER .. py:data:: _UBUNTU_GCC .. py:data:: _DEBIAN_GCC .. py:function:: image_from_dockerfile(path: str) -> Optional[str] Return the base image of the final stage of a Dockerfile. .. py:function:: image_from_comment(binary: str) -> Optional[str] Guess the distribution image from the compiler string in .comment. .. py:function:: detect_image(binary: str) -> Tuple[str, str] Detect the container image for a binary. Checks a Dockerfile next to the binary (then in the working directory) and falls back to the compiler string in the binary's .comment section. :return: tuple of image and the source it was detected from :raises ValueError: if no image could be detected