stevedore
Stevedore manages labels in Dockerfiles and their layers
Table of Contents
Install
Download the latest binary here:
https://github.com/JamesWoolfenden/stevedore/releases
Install from code:
- Clone repo
- Run
go install
Install remotely:
go install github.com/jameswoolfenden/stevedore@latest
MacOS
brew tap jameswoolfenden/homebrew-tap
brew install jameswoolfenden/tap/stevedore
Windows
I'm now using Scoop to distribute releases,
it's much quicker to update and easier to manage than previous methods,
you can install scoop from https://scoop.sh/.
Add my scoop bucket:
scoop bucket add iac https://github.com/JamesWoolfenden/scoop.git
Then you can install a tool:
scoop install stevedore
Docker
docker pull jameswoolfenden/stevedore
docker run --tty --volume /local/path/to/tf:/tf jameswoolfenden/stevedore scan -d /tf
https://hub.docker.com/repository/docker/jameswoolfenden/stevedore
Usage
Directory scan
This will look for the .github/workflow folder and update all the files it finds
there, and display a diff of the changes made to each file:
$stevedore label -d .
Individual file scan
$stevedore label -f Dockerfile
_ _
___| |_ ___ __ __ ___ __| | ___ _ _ ___
(_-<| _|/ -_)\ V // -_)/ _` |/ _ \| '_|/ -_)
/__/ \__|\___| \_/ \___|\__,_|\___/|_| \___|
version: 9.9.9
1:44PM INF opening: Dockerfile
1:44PM INF file: Dockerfile
1:44PM INF label: LABEL layer.0.author="James Woolfenden" layer.0.trace="e130a2d2-0fd6-47b5-a32b-52c408e939e4" layer.0.tool="stevedore"
1:44PM INF updated: Dockerfile
➜ stevedore git:(main) ✗
The Dockerfile now has labels:
FROM alpine
RUN apk --no-cache add build-base git curl jq bash
RUN curl -s -k https://api.github.com/repos/JamesWoolfenden/stevedore/releases/latest | jq '.assets[] | select(.name | contains("linux_386")) | select(.content_type | contains("gzip")) | .browser_download_url' -r | awk '{print "curl -L -k " $0 " -o ./stevedore.tar.gz"}' | sh
RUN tar -xf ./stevedore.tar.gz -C /usr/bin/ && rm ./stevedore.tar.gz && chmod +x /usr/bin/stevedore && echo 'alias stevedore="/usr/bin/stevedore"' >> ~/.bashrc
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
LABEL layer.0.author="James Woolfenden" layer.0.trace="e130a2d2-0fd6-47b5-a32b-52c408e939e4" layer.0.tool="stevedore"
Help
NAME:
stevedore - Update Dockerfile labels
USAGE:
stevedore [global options] command [command options] [arguments...]
VERSION:
9.9.9
AUTHOR:
James Woolfenden <jim.wolf@duck.com>
COMMANDS:
label, l Updates Dockerfiles labels
version, v Outputs the application version
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
Building
go build
or
Make build
Extending
Log an issue, a pr or email jim.wolf @ duck.com.