-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-dev
80 lines (58 loc) · 1.67 KB
/
Dockerfile-dev
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM alpine:latest as build
RUN apk --no-cache add curl tar gzip
#
# Install JDK
#
RUN curl https://cdn.azul.com/zulu/bin/zulu11.33.15-ca-jdk11.0.4-linux_musl_x64.tar.gz -o /jdk.tar.gz
RUN mkdir -p /jdk
RUN tar xzf /jdk.tar.gz --strip-components=1 -C /jdk
ENV PATH=/jdk/bin:$PATH
ENV JAVA_HOME=/jdk
#
# Build LDS Server
#
RUN ["jlink", "--strip-debug", "--no-header-files", "--no-man-pages", "--compress=2", "--module-path", "/jdk/jmods", "--output", "/linked",\
"--add-modules", "jdk.unsupported,java.base,java.management,java.net.http,java.xml,java.naming,java.desktop,java.sql"]
#
# Build LDS image
#
FROM alpine:latest as base
#
# Resources from build image
#
COPY run.sh /lds/run.sh
COPY --from=build /linked /jdk/
COPY target/dependency /lds/lib/
COPY target/linked-data-store-*.jar /lds/lib/
ENV PATH=/jdk/bin:$PATH
WORKDIR /lds
VOLUME ["/lds/conf", "/lds/schemas"]
EXPOSE 9090
CMD ["./run.sh"]
FROM descoped/raml-to-jsonschema:latest AS gsim-convert
ARG GSIM_VERSION
RUN apk update && \
apk upgrade && \
apk add git
# Fetch the latest schema
RUN git clone https://github.com/descoped/gsim-raml-schema /gsim
RUN git -C /gsim checkout ${GSIM_VERSION:-HEAD}
WORKDIR /gsim
RUN ["java", "-cp", "/opt/raml-to-jsonschema/bin/*", "no.ssb.raml.RamltoJsonSchemaConverter", "/gsim/jsonschemas/", "/gsim/schemas/"]
#
# Build LDS image
#
FROM alpine:latest as gsim
#
# Resources from build image
#
COPY run.sh /lds/run.sh
COPY --from=build /linked /jdk/
COPY target/dependency /lds/lib/
COPY target/linked-data-store-*.jar /lds/lib/
COPY --from=gsim-convert /gsim/jsonschemas/ /schemas
ENV PATH=/jdk/bin:$PATH
WORKDIR /lds
VOLUME ["/lds/conf", "/lds/schemas"]
EXPOSE 9090
CMD ["./run.sh"]