Skip to content

shivjm/dockerfile-image-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dockerfile-image-tags

version semantic versioning

test

List or query images and tags used in a Dockerfile.

Usage

List all images and tags

Pass path to Dockerfile:

dockerfile-image-tags list path/to/Dockerfile

Or pass Dockerfile as input:

cat path/to/Dockerfile | dockerfile-image-tags list

Sample output (JSON):

[{"name":"golang","tag":"1.17.0-alpine"},{"name":"common","tag":"?"},{"name":"common","tag":"?"},{"name":"common","tag":"?"},{"name":"viaductoss/ksops","tag":"v3.0.0"},{"name":"quay.io/argoproj/argocd","tag":"$ARGOCD_VERSION"}]

Find single image tag

Use query to return tag for first occurrence of image with specified name:

dockerfile-image-tags query path/to/Dockerfile golang

Pass -n (--occurrence) to return specified occurrence instead of first occurrence. For example, to return tag for second FROM golang:

dockerfile-image-tags query -n 2 path/to/Dockerfile golang

Sample output:

1.17.0-alpine

Docker image

See shivjm/dockerfile-image-tags packages.