Skip to content

Commit 71ed54a

Browse files
Add Dockerfile
1 parent ea4bcc2 commit 71ed54a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Diff for: Dockerfile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM maven:3.3.9-jdk-8-alpine
2+
3+
MAINTAINER Code Climate
4+
5+
# Create user and app directory
6+
RUN adduser -u 9000 -D app
7+
COPY . /usr/src/app
8+
RUN chown -R app:app /usr/src/app
9+
10+
# Package the app with Maven
11+
WORKDIR /usr/src/app
12+
RUN mvn package
13+
14+
# Unzip the packaged app
15+
RUN mkdir /usr/src/app/dest
16+
RUN unzip /usr/src/app/target/sonarlint-cli-*.zip \
17+
-d /usr/src/app/dest
18+
RUN cp -R /usr/src/app/dest/sonarlint-cli-*/* \
19+
/usr/src/app/dest
20+
21+
# Specify the /code volume
22+
# as needed by CC
23+
VOLUME /code
24+
25+
# Create a writeable directory for the code
26+
RUN mkdir -p /code-read-write
27+
RUN chown -R app:app /code-read-write
28+
RUN chmod -R 777 /code-read-write
29+
30+
# Switch to app user, copy code to writable
31+
# directory, and run the engine
32+
USER app
33+
ENTRYPOINT []
34+
WORKDIR /code-read-write
35+
CMD cp -R /code/* . && \
36+
/usr/src/app/dest/bin/sonarlint

0 commit comments

Comments
 (0)