vagd.detect

Attributes

_FROM

_ARG

_VAR

_UBUNTU_RELEASE

_COMPILER

_UBUNTU_GCC

_DEBIAN_GCC

Functions

image_from_dockerfile(→ Optional[str])

Return the base image of the final stage of a Dockerfile.

image_from_comment(→ Optional[str])

Guess the distribution image from the compiler string in .comment.

detect_image(→ Tuple[str, str])

Detect the container image for a binary.

Module Contents

vagd.detect._FROM
vagd.detect._ARG
vagd.detect._VAR
vagd.detect._UBUNTU_RELEASE
vagd.detect._COMPILER
vagd.detect._UBUNTU_GCC
vagd.detect._DEBIAN_GCC
vagd.detect.image_from_dockerfile(path: str) → str | None

Return the base image of the final stage of a Dockerfile.

vagd.detect.image_from_comment(binary: str) → str | None

Guess the distribution image from the compiler string in .comment.

vagd.detect.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.

Returns:

tuple of image and the source it was detected from

Raises:

ValueError – if no image could be detected