dtm

command module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Unlicense Imports: 11 Imported by: 0

README

Docker Tag Monitor (dtm)

Purpose

The overall goal is to prune older versioned images/tags, and keep only the leading edge.

Specifically, for any given repository/image:

  • If there is a latest, keep it
  • If there is, e.g. a 1 and a 1.2, keep both, even if they do not point to the same hash
  • If there is, e.g. 1 and 1.2 and 1.2.3, keep all, as above
  • Remove everything else that doesn't qualify

Usage

If you are using a non-standard container engine (CE) host, i.e. anything that isn't unix:///var/run/docker.sock, then the DOCKER_HOST environment variable needs to be set when running dtm:

export DOCKER_HOST="$(docker context inspect --format="{{ .Endpoints.docker.Host }}")"
dtm

Correctness

Check the output of dtm against docker proper with the following comparison:

delta \
  <(DOCKER_HOST="$(docker context inspect --format="{{ .Endpoints.docker.Host }}")" ./dtm | sort -f) \
  <(docker images --format='table {{ .Repository }}\t{{ .Tag }}\t{{ .ID }}' | tail -n +2 | sort -f)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL