forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (37 loc) · 1.6 KB
/
Dockerfile
File metadata and controls
40 lines (37 loc) · 1.6 KB
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
# ============================================================
# Build stage 1: Builder
# ============================================================
FROM maven:3.6-jdk-8-slim as builder
ARG REVISION=dev
COPY . /build
WORKDIR /build
#
# Setting Maven repository .m2 directory relative to /build folder gives the
# user to optionally use cached repository when building the image by copying
# the existing .m2 directory to $FEAST_REPO_ROOT/.m2
#
ENV MAVEN_OPTS="-Dmaven.repo.local=/build/.m2/repository -DdependencyLocationsEnabled=false"
RUN mvn --also-make --projects core,ingestion -Drevision=$REVISION \
-DskipTests=true --batch-mode package
#
# Unpack the jar and copy the files into production Docker image
# for faster startup time when starting Dataflow jobs from Feast Core.
# This is because we need to stage the classes and dependencies when using Dataflow.
# The final size of the production image will be bigger but it seems
# a good tradeoff between speed and size.
#
# https://github.com/gojek/feast/pull/291
RUN apt-get -qq update && apt-get -y install unar && \
unar /build/core/target/feast-core-$REVISION.jar -o /build/core/target/
# ============================================================
# Build stage 2: Production
# ============================================================
FROM openjdk:8-jre as production
ARG REVISION=dev
COPY --from=builder /build/core/target/feast-core-$REVISION.jar /opt/feast/feast-core.jar
COPY --from=builder /build/core/target/feast-core-$REVISION /opt/feast/feast-core
CMD ["java",\
"-Xms2048m",\
"-Xmx2048m",\
"-jar",\
"/opt/feast/feast-core.jar"]