stevedore
is a small command line tool taking it’s name from the worker, working on the dock with loading cargo unto ships.
REF: Wikipedia
The tool reads a given directory and Docker ignore file (.dockerignore
) and outputs a report on what is to be included in a Docker image and what will be ignored.
Like so:
stevedore .
The above example
.dockerignore
file.
) recursively.dockerignore
file with the contents of the specified directory.
.dockerignore
.gitignore
README.md
TODO
go.mod
go.sum
main.go
stevedore
You can actually emit the path parameter, since stevedore
defaults to current directory.
Since this is just an analysis/reporting tool it can be fed with parameters to diverge from the default behaviour.
--help
/ -h
emits a brief help message--ignorefile <path>
/ -i
points to alternative ignore file--color
/ -c
emits output on color--nocolor
/ -n
emits output suppressing use of colors--verbose
/ -v
emits more verbose output--debug
emits debug information--included
emits only included files (non-ignored)--excluded
emits only excluded files (ignored)--invertcolors
inverts the used colors--stdin
/ -s
reads ignore file from STDIN--fullpath
/ -f
emits full path of encountered files and directoriesPrecedence for configuration of parameters are:
Use the global configuration file for the configuration you prefer for all you projects and invocations.
Add a local configuration file, where you want to continuously override the global configuration for that particular directory and for all your invocations.
See Configuration section for details on configuration.
If the verbose flag is set the output is altered and is more explanatory:
stevedore -verbose .
path . is not ignored and is included in Docker image
path .dockerignore is not ignored and is included in Docker image
path .gitignore is not ignored and is included in Docker image
path README.md is not ignored and is included in Docker image
path TODO is not ignored and is included in Docker image
path go.mod is not ignored and is included in Docker image
path go.sum is not ignored and is included in Docker image
path main.go is ignored and is included in Docker image
path stevedore is not ignored and is included in Docker image
If you have a ignore file and you want to pass it to stevedore
you can either use, the --ignorefile parameter
:
stevedore --ignorefile /path/to/my/ignorefile
Or you can pass it in via STDIN:
cat /path/to/my/ignorefile | stevedore --stdin
These will render the same result.
If you find yourself constantly writing out the same command line parameters, you have several options for for using a configuration file:
.stevedore.json
$HOME/.config/stevedore/config.json
You can in either file specify the setting for all command line arguments, with a JSON key/value structure:
{
"$schema": "stevedore-config.schema.json",
"color": true,
"debug": false,
"excluded": false,
"fullpath": true,
"ignorefile": ".stevedoreignore",
"included": false,
"invertcolor": false,
"verbose": false
}
Parameters not available for configuration:
--help
--stdin
Precedence for the configuration files are:
Use the global configuration file for the configuration you prefer for all you projects and invocations.
Add a local configuration file, where you want to continuously override the global configuration for that particular directory and for all your invocations.
See also Configuration for more details.
See Parameters section for details on parameters.
0
indicates a successful run1
ignore file was not found or could not be read2
specified directory could not be read or only partially readYou can add an ignore file, named .stevedoreignore
to your directory. It will tell stevedore
what files and directories to ignore prior to making it’s analysis.
Meaning that patterns in this files matched, will be excluded.
The .stevedoreignore
file follows the general implementation pattern. and example could be:
.git
stevedore
support locating a configuration file in:
$HOME/.config/stevedore
config.json
The directory can be specified using the environment variable:
$XDG_CONFIG_HOME
, the default is: $HOME/.config
. If the environment variable is not set, the default is evaluated.
Do note stevedore
does not support: $XDG_CONFIG_DIRS
.
See Configuration section for details on configuration.
.dockerignore
(main purpose).gitignore
.yakignore
stevedore
does not support:
path/filepath
documentation for WalkDir
function$XDG_CONFIG_DIRS
which are part of the “XDG Base Directory Specification” are not supported at this timeSee Configuration section for details on configuration.
path/filepath
documentation for WalkDir
function