Skip to content

Commit

Permalink
Merge pull request #5 from rody/use-jre
Browse files Browse the repository at this point in the history
feat: use JRE 8 on alpine 3.9
  • Loading branch information
rody authored Nov 15, 2021
2 parents 94166b6 + 78fe306 commit 65e26fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
FROM openjdk:8-alpine
FROM openjdk:8-jre-alpine3.9

ARG PMD_VERSION=${PMD_VERSION:-6.40.0}

RUN apk add --update --no-cache wget unzip
RUN mkdir -p /opt

RUN cd /opt \
&& apk add --no-cache --virtual .build-deps wget unzip \
&& wget -nc -O pmd.zip https://github.com/pmd/pmd/releases/download/pmd_releases/${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip \
&& unzip pmd.zip \
&& rm -f pmd.zip \
&& mv pmd-bin-${PMD_VERSION} pmd
&& mv pmd-bin-${PMD_VERSION} pmd \
&& apk del .build-deps

COPY pmd /usr/bin/pmd
COPY cpd /usr/bin/cpd
RUN chmod +x /usr/bin/pmd /usr/bin/cpd
RUN apk add --update --no-cache dumb-init

RUN mkdir /src
VOLUME /src
WORKDIR /src

CMD ["pmd"]

ENTRYPOINT [ "/usr/bin/dumb-init", "/usr/bin/java", "-classpath", "/opt/pmd/lib/*", "net.sourceforge.pmd.PMD" ]
CMD ""
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ In order to run this container you'll need docker installed.

ex: Java analysis with custom rulesets

`docker run -v $PWD:/src rawdee/pmd pmd -language java -dir . -rulesets ./my-rulesets.xml`
`docker run -v $PWD:/src rawdee/pmd -language java -dir . -rulesets ./my-rulesets.xml`

ex: Apex analysis with builtin rulesets

`docker run -v $PWD:/src rawdee/pmd pmd -language apex -dir . -rulesets rulesets/apex/rulset.xml`
`docker run -v $PWD:/src rawdee/pmd -language apex -dir . -rulesets rulesets/apex/ruleset.xml`

#### Volumes

Expand Down
3 changes: 0 additions & 3 deletions cpd

This file was deleted.

3 changes: 0 additions & 3 deletions pmd

This file was deleted.

0 comments on commit 65e26fe

Please sign in to comment.