diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4f1c4bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM openjdk:13-alpine +LABEL author="ian@iamthefij.com" + +ENV VERSION=6.12.0 + +RUN apk add bash curl unzip + +RUN curl -L -o pmd.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F${VERSION}/pmd-bin-${VERSION}.zip && \ + unzip pmd.zip && \ + rm pmd.zip + +RUN mv /pmd-bin-${VERSION} /pmd +WORKDIR /pmd + +USER nobody + +ENTRYPOINT ["./bin/run.sh", "pmd"] diff --git a/README.md b/README.md index ee54594..ca229f2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # docker-pmd -OpenJDK based Docker image for running PMD \ No newline at end of file +OpenJDK based Docker image for running PMD + +## Usage + +To run, create a rules.xml file, or download one from the [git repo](https://github.com/pmd/pmd). + +After that, you can run using the following command: + + docker run -v $(pwd):/src:ro --rm iamthefij/pmd -d /src -f textcolor -R /src/quickstart.xml + +## Building +Clone this repo and then run + + docker build -f Dockerfile . -t pmd-test +