Skip to main content

Module docker_image

Module docker_image 

Source
Expand description

Docker image reference value object

This module provides a strongly-typed Docker image reference that combines a repository name with a tag. It is used to represent Docker images in service configurations and templates.

§Design Decision

Docker image versions are not user-configurable — they are pinned as constants in the code to ensure compatibility between the deployer and the images it uses. Exposing them through domain configs (rather than hardcoding in templates) gives us:

  • A single source of truth for each image version
  • The ability to inspect images via the show command
  • Automatic propagation of version changes to both templates and CI scanning

§Examples

use torrust_tracker_deployer_lib::shared::docker_image::DockerImage;

let image = DockerImage::new("torrust/tracker", "develop");
assert_eq!(image.full_reference(), "torrust/tracker:develop");
assert_eq!(image.repository(), "torrust/tracker");
assert_eq!(image.tag(), "develop");

Structs§

DockerImage
Docker image reference with repository and tag