Skip to contents

Analyzes a Docker base image name to determine the underlying distribution

Usage

determine_linux_distribution(base_image)

Arguments

base_image

Base image name

Value

Character string of OS type (e.g., "ubuntu", "centos", "debian", "alpine")

Details

This function parses the base image name to extract the underlying distribution. For Rocker Project images (which are based on Ubuntu/Debian), it returns "ubuntu". For other distributions, it attempts to identify common ones like Debian, CentOS, Fedora, Alpine, etc.

See also

determine_package_manager() for determining the package manager & map_to_sysreqs_platform() for mapping to sysreqs platform

Other utility functions: determine_package_manager(), dk_add_sysreqs(), map_to_sysreqs_platform()

Examples

determine_linux_distribution("rocker/r-ver:4.4.0")  # Returns "ubuntu"
#> [1] "ubuntu"
determine_linux_distribution("alpine:3.16")         # Returns "alpine"
#> [1] "alpine"
determine_linux_distribution("centos:7")            # Returns "centos"
#> [1] "centos"