Merge pull request #44 from rotemreiss/docker-support

Add Docker support.
This commit is contained in:
Marc Cohen
2020-09-06 12:09:28 +01:00
committed by GitHub
2 changed files with 28 additions and 0 deletions

10
Dockerfile Normal file
View File

@@ -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"]

View File

@@ -23,6 +23,24 @@ to any file that already has one.
The pattern argument can be provided multiple times, and may also refer The pattern argument can be provided multiple times, and may also refer
to single files. 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 ## license
Apache 2.0 Apache 2.0