Skip to content

Commit

Permalink
docs: update docker instructions to include GitHub container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
willnorris committed Aug 16, 2021
1 parent 2fe3ee9 commit 612dddd
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -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 -v ${PWD}:/src -it google/addlicense -c "Google LLC" *.go
docker run -it ghcr.io/google/addlicense -v ${PWD}:/src -c "Google LLC" *.go
```

## license
Expand Down

0 comments on commit 612dddd

Please sign in to comment.