File tree 2 files changed +35
-4
lines changed 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 1
- FROM groovy:jre8-alpine
2
-
1
+ #
2
+ # Build stage
3
+ #
4
+ FROM groovy:jre8-alpine as builder
3
5
MAINTAINER "Jeremy Isikoff <jeremy+codeclimate-codenarc@cinchfinancial.com>"
4
6
5
7
USER root
@@ -8,11 +10,41 @@ RUN apk update && \
8
10
apk add ca-certificates wget curl jq && \
9
11
update-ca-certificates
10
12
13
+ COPY . /usr/src/app
14
+
15
+ WORKDIR /usr/src/app
16
+
17
+ RUN ./gradlew clean compileGroovy infra test --info
18
+
19
+ #
20
+ # Runtime
21
+ #
22
+ FROM groovy:jre8-alpine
23
+ MAINTAINER "Jeremy Isikoff <jeremy+codeclimate-codenarc@cinchfinancial.com>"
24
+
25
+ USER root
26
+
27
+ WORKDIR /usr/src/app
28
+
29
+ # Test and debug depedencies
30
+ COPY --from=builder /usr/src/app/Dockerfile /usr/src/app/Dockerfile
31
+ COPY --from=builder /usr/src/app/engine.json /usr/src/app/engine.json
32
+ COPY --from=builder /usr/src/app/build.gradle /usr/src/app/build.gradle
33
+ COPY --from=builder /usr/src/app/gradle /usr/src/app/gradle
34
+ COPY --from=builder /usr/src/app/gradlew /usr/src/app/gradlew
35
+ COPY --from=builder /usr/src/app/fixtures /usr/src/app/fixtures
36
+
37
+ # Runtime dependencies
38
+ COPY --from=builder /usr/src/app/src /usr/src/app/src
39
+ COPY --from=builder /usr/src/app/lib /usr/src/app/lib
40
+ COPY --from=builder /usr/src/app/codenarc /usr/src/app/codenarc
41
+
42
+
11
43
RUN adduser -u 9000 -D app
12
44
13
45
VOLUME /code
14
46
WORKDIR /code
15
- COPY . /usr/src/app
47
+
16
48
RUN chown -R app:app /usr/src/app
17
49
18
50
USER app
Original file line number Diff line number Diff line change 3
3
IMAGE_NAME ?= codeclimate/codeclimate-codenarc
4
4
5
5
image :
6
- ./gradlew clean compileGroovy infra
7
6
docker build --rm -t $(IMAGE_NAME ) .
8
7
9
8
test : image
You can’t perform that action at this time.
0 commit comments