Merge pull request #44 from rotemreiss/docker-support
Add Docker support.
This commit is contained in:
10
Dockerfile
Normal file
10
Dockerfile
Normal 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"]
|
||||||
18
README.md
18
README.md
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user