stevedore

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

stevedore

alt text

Maintenance Build Status Latest Release GitHub tag (latest SemVer) Terraform Version pre-commit checkov Github All Releases

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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