-
Notifications
You must be signed in to change notification settings - Fork 438
/
Copy pathDockerfile
40 lines (32 loc) · 1.36 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
FROM ubuntu:20.04
ARG SDKMAN_JAVA_INSTALLATION=17.0.1-tem
ARG THIN_REPO=https://repo.spring.io/snapshot
LABEL Author="Marcin Grzejszczak <[email protected]>"
LABEL Author="Bastian Doetsch <[email protected]>"
RUN apt-get update && apt-get install -y curl \
unzip \
zip \
&& apt-get clean
RUN useradd -u1000 -m scc
# Install sdkman and java
COPY sdkman/ /usr/local/bin/
RUN chmod +r+x /usr/local/bin/sdkman-wrapper.sh
USER scc
WORKDIR /home/scc
RUN curl -s https://get.sdkman.io/ | bash
COPY --chown=scc sdkman.config /home/scc/.sdkman/etc/config
RUN bash -c "source /home/scc/.sdkman/bin/sdkman-init.sh"
RUN bash -c "sdkman-wrapper.sh install java ${SDKMAN_JAVA_INSTALLATION}"
ENV JAVA_HOME /home/scc/.sdkman/candidates/java/current/
ENV PATH "${PATH}:${JAVA_HOME}/bin"
# Spring Cloud Contract
ENV SERVER_PORT 8750
VOLUME /tmp
COPY --chown=scc:scc target/maven_dependencies /home/scc/.m2/repository/
COPY --chown=scc:scc target/libs/stub-runner-boot.jar stub-runner-boot.jar
RUN echo "Fetching dependencies, please wait..."
RUN java -Dthin.dryrun=true -jar stub-runner-boot.jar --thin.repo=${THIN_REPO}
RUN java -Dthin.dryrun=true -jar stub-runner-boot.jar --thin.profile=rabbit --thin.repo=${THIN_REPO}
RUN java -Dthin.dryrun=true -jar stub-runner-boot.jar --thin.profile=kafka --thin.repo=${THIN_REPO}
COPY --chown=scc:scc run.sh run.sh
ENTRYPOINT ["./run.sh"]