forked from wikimedia/wikidata-query-rdf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (26 loc) · 1003 Bytes
/
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
FROM maven:3.6.0-jdk-8 AS builder
LABEL maintainer='Yuri Astrakhan <YuriAstrakhan@gmail.com>'
RUN mkdir -p /app \
&& mkdir -p /app-src
COPY . /app-src
# Extract the version number from the line right above the <packaging>pom</packaging>
# Compile (currently tests are skipped, but should be enabled in the future)
# Unzip to /app
# Cleanup
RUN cd /app-src \
&& BLAZE_VERSION=$(grep --before-context=1 '<packaging>pom</packaging>' pom.xml \
| head -n 1 \
| sed 's/^[^>]*>\([^<]*\)<.*$/\1/g') \
&& echo "########### Building Blazegraph ${BLAZE_VERSION}" \
&& mvn package -DskipTests=true -DskipITs=true \
&& unzip -d /app /app-src/dist/target/service-${BLAZE_VERSION}-dist.zip \
&& mv /app/service-${BLAZE_VERSION}/* /app \
&& rmdir /app/service-${BLAZE_VERSION}
#
# Create the actual production image
#
FROM openjdk:8-jdk
LABEL maintainer='Yuri Astrakhan <YuriAstrakhan@gmail.com>'
WORKDIR /app
COPY --from=builder /app .
ENTRYPOINT ["/bin/bash"]