Skip to main content

parse_image_ref

Function parse_image_ref 

Source
pub fn parse_image_ref(full: &str) -> ImageRef
Expand description

Split a full image reference string into its registry host and repository.

Applies the standard Docker heuristic: the segment before the first / is the registry host iff it contains a . or a : (a hostname or host:port); otherwise there is no host and the whole string is a repository under the default registry (ghcr.io).

§Examples

  • us-east4-docker.pkg.dev/official-unofficial/docker/polychrome-control-plane → registry us-east4-docker.pkg.dev, repo official-unofficial/docker/polychrome-control-plane.
  • officialunofficial/polychrome → registry ghcr.io, repo officialunofficial/polychrome.