-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
47 lines (35 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM ruby:2.6.3-alpine
ENV LANG C.UTF-8
MAINTAINER "Code Climate <[email protected]>"
RUN adduser -u 9000 -D app
# based on https://github.com/docker-library/openjdk/blob/master/8-jre/alpine/Dockerfile
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/jre
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
ENV JAVA_VERSION 8u252
ENV JAVA_ALPINE_VERSION 8.275.01-r0
RUN set -x \
&& apk update && apk add --no-cache --update \
openjdk8-jre="$JAVA_ALPINE_VERSION" \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
COPY bin/install-checkstyle.sh /usr/src/app/bin/
RUN chown -R app:app /usr/src/app
RUN ./bin/install-checkstyle.sh
RUN apk add --update make g++ git curl && bundle install
VOLUME /code
WORKDIR /code
COPY . /usr/src/app
RUN chown -R app:app /usr/src/app
USER app
CMD ["/usr/src/app/bin/codeclimate-checkstyle"]