From 952f8b4ce9b6a693566e431a727d36ba6134068a Mon Sep 17 00:00:00 2001 From: Rotem Reiss Date: Wed, 8 Jul 2020 15:37:35 +0300 Subject: [PATCH] Add Docker support. --- Dockerfile | 10 ++++++++++ README.md | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e60bdef --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 624a680..6c0d5be 100644 --- a/README.md +++ b/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 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