Giter VIP home page Giter VIP logo

dockmoor's Introduction

dockmoor

Build Status (Circle CI) Coveralls statement coverage Go Report Card GitHub release Follow @MeneDev on Twitter

Manage docker image references.

Examples

list command

The single file examples all refer to a multi-stage build Dockerfile

List all image references in file

dockmoor list --any Dockerfile

stdout:

image-name
image-name:latest
image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
image-name:1.12
image-name:1.12@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
image-name@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
example.com/image-name
example.com/image-name:latest
example.com/image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
example.com/image-name:1.12
example.com/image-name:1.12@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
example.com/image-name@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf

stderr is empty
exit code: 0

List all image references with latest or no tag in file

dockmoor list --latest Dockerfile

stdout:

image-name
image-name:latest
image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
example.com/image-name
example.com/image-name:latest
example.com/image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf

stderr is empty
exit code: 0

List all unpinned image references

dockmoor list --unpinned Dockerfile

stdout:

image-name
image-name:latest
image-name:1.12
example.com/image-name
example.com/image-name:latest
example.com/image-name:1.12

stderr is empty
exit code: 0

Use unix find to list all unpinned image references

find some-folder/ -type f -exec dockmoor list --unpinned {} \; | sort | uniq

stdout:

nginx
nginx:1.15.3
nginx:latest

stderr is empty
exit code: 0

Use unix find to list all image references with latest/no tags

find some-folder/ -type f -exec dockmoor list --latest {} \; | sort | uniq

stdout:

nginx
nginx:latest

stderr is empty
exit code: 0

Use unix find to list all image references

find some-folder/ -type f -exec dockmoor list --any {} \; | sort | uniq

stdout:

nginx
nginx:1.15.3
nginx:1.15.3-alpine@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
nginx:latest
nginx@sha256:db5acc22920799fe387a903437eb89387607e5b3f63cf0f4472ac182d7bad644

stderr is empty
exit code: 0

contains command

Use unix find to list all files containing unpinned references

find some-folder/ -type f -exec dockmoor contains --unpinned {} \; -print

stdout:

stderr is empty
exit code: 0

Use unix find to list all files containing latest/no tags

find some-folder/ -type f -exec dockmoor contains --latest {} \; -print

stdout:

stderr is empty
exit code: 0

Test the format of a file

The contains command returns with exit code 0 when an image reference was found that matches. Using the --any predicate allows to match any file with a supported format that contains at least one image reference.

dockmoor contains --any Dockerfile

stdout is empty
stderr is empty
exit code: 0

dockmoor contains --any some-folder/NotADockerfile

stdout is empty
stderr is empty
exit code: 4

Supported Formats

Usage

dockmoor [OPTIONS] <contains | list> [command-OPTIONS]

Application Options

-l, --log-level Sets the log-level (one of NONE, ERROR, WARN, INFO, DEBUG)

--version Show version and exit

--manpage Show man page and exit

--markdown Show usage as markdown and exit

--asciidoc-usage Show usage as asciidoc and exit

Help Options

-h, --help Show this help message

Commands

contains command

dockmoor [OPTIONS] contains [contains-OPTIONS] InputFile

Test if a file contains image references with matching predicates. Returns exit code 0 when the given input contains at least one image reference that satisfy the given conditions and is of valid format, non-null otherwise

Predicates

Specify which kind of image references should be selected. Exactly one must be specified

--any Matches all images

--latest Matches images with latest or no tag

--unpinned Matches unpinned images

Help Options

-h, --help Show this help message

list command

dockmoor [OPTIONS] list [list-OPTIONS] InputFile

List image references with matching predicates. Returns exit code 0 when the given input contains at least one image reference that satisfy the given conditions and is of valid format, non-null otherwise

Predicates

Specify which kind of image references should be selected. Exactly one must be specified

--any Matches all images

--latest Matches images with latest or no tag

--unpinned Matches unpinned images

Help Options

-h, --help Show this help message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.