Skip to content

Commit

Permalink
Add Docker support.
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemreiss committed Jul 8, 2020
1 parent df58aca commit 952f8b4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1-alpine AS build-env

RUN apk add --no-cache --upgrade git openssh-client ca-certificates
RUN go get -u github.com/golang/dep/cmd/dep
WORKDIR /go/src/app

# Install
RUN go get -u github.com/google/addlicense

ENTRYPOINT ["addlicense"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ to any file that already has one.
The pattern argument can be provided multiple times, and may also refer
to single files.

## Running in a Docker Container

- Clone the repository using `git clone https://github.com/google/addlicense.git`
- Build your docker container
```bash
docker build -t google/addlicense .
```

- Test the image
```bash
docker run -it google/addlicense -h
```

- Usage example
```bash
docker run -v ${PWD}:/go/src/app/ -it google/addlicense -c "Google LLC" *.go
```

## license

Apache 2.0
Expand Down

0 comments on commit 952f8b4

Please sign in to comment.