From 944049f284c118a4ad5dba7301c11b2c9936c11d Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 16 Aug 2021 16:30:50 -0700 Subject: [PATCH] docs: update docker instructions to include GitHub container registry --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f5dcdd6..1cca434 100644 --- a/README.md +++ b/README.md @@ -31,20 +31,30 @@ doublestar](https://github.com/bmatcuk/doublestar#patterns). ## Running in a Docker Container -- Clone the repository using `git clone https://github.com/google/addlicense.git` -- Build your docker container +The simplest way to get the addlicense docker image is to pull from GitHub +Container Registry: + ```bash -docker build -t google/addlicense . +docker pull ghcr.io/google/addlicense:latest ``` -- Test the image +Alternately, you can build it from source yourself: + ```bash -docker run -it google/addlicense -h +docker build -t ghcr.io/google/addlicense . ``` -- Usage example +Once you have the image, you can test that it works by running: + ```bash -docker run -v ${PWD}:/src -it google/addlicense -c "Google LLC" *.go +docker run -it ghcr.io/google/addlicense -h +``` + +Finally, to run it, mount the directory you want to scan to `/src` and pass the +appropriate addlicense flags: + +```bash +docker run -it ghcr.io/google/addlicense -v ${PWD}:/src -c "Google LLC" *.go ``` ## license