Skip to content

Commit fb893de

Browse files
Update base Docker image for building Feast Serving image (#535)
* Update base Docker image for building Feast Serving image - Add clean phase before packaging for more deterministic build (in case host directory is dirty) - Move the downloading of grpc-health-probe in Feast Serving to build stage so the production stage does not need extra tools like wget, for slimmer production image. * Update base Docker image for Feast Serving in Dockerfile.dev
1 parent afe9542 commit fb893de

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

infra/docker/core/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /build
1313
#
1414
ENV MAVEN_OPTS="-Dmaven.repo.local=/build/.m2/repository -DdependencyLocationsEnabled=false"
1515
RUN mvn --also-make --projects core,ingestion -Drevision=$REVISION \
16-
-DskipTests=true --batch-mode package
16+
-DskipTests=true --batch-mode clean package
1717
#
1818
# Unpack the jar and copy the files into production Docker image
1919
# for faster startup time when starting Dataflow jobs from Feast Core.
@@ -32,6 +32,7 @@ RUN apt-get -qq update && apt-get -y install unar && \
3232
FROM openjdk:11-jre as production
3333
ARG REVISION=dev
3434
COPY --from=builder /build/core/target/feast-core-$REVISION.jar /opt/feast/feast-core.jar
35+
# Required for staging jar dependencies when submitting Dataflow jobs.
3536
COPY --from=builder /build/core/target/feast-core-$REVISION /opt/feast/feast-core
3637
CMD ["java",\
3738
"-Xms2048m",\

infra/docker/serving/Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Build stage 1: Builder
33
# ============================================================
44

5-
FROM maven:3.6-jdk-11-slim as builder
5+
FROM maven:3.6-jdk-11 as builder
66
ARG REVISION=dev
77
COPY . /build
88
WORKDIR /build
@@ -13,22 +13,23 @@ WORKDIR /build
1313
#
1414
ENV MAVEN_OPTS="-Dmaven.repo.local=/build/.m2/repository -DdependencyLocationsEnabled=false"
1515
RUN mvn --also-make --projects serving -Drevision=$REVISION \
16-
-DskipTests=true --batch-mode package
17-
18-
# ============================================================
19-
# Build stage 2: Production
20-
# ============================================================
21-
22-
FROM openjdk:11-jre-alpine as production
23-
ARG REVISION=dev
16+
-DskipTests=true --batch-mode clean package
2417
#
2518
# Download grpc_health_probe to run health check for Feast Serving
2619
# https://kubernetes.io/blog/2018/10/01/health-checking-grpc-servers-on-kubernetes/
2720
#
2821
RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.1/grpc_health_probe-linux-amd64 \
2922
-O /usr/bin/grpc-health-probe && \
3023
chmod +x /usr/bin/grpc-health-probe
24+
25+
# ============================================================
26+
# Build stage 2: Production
27+
# ============================================================
28+
29+
FROM openjdk:11-jre-slim as production
30+
ARG REVISION=dev
3131
COPY --from=builder /build/serving/target/feast-serving-$REVISION.jar /opt/feast/feast-serving.jar
32+
COPY --from=builder /usr/bin/grpc-health-probe /usr/bin/grpc-health-probe
3233
CMD ["java",\
3334
"-Xms1024m",\
3435
"-Xmx1024m",\

infra/docker/serving/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:11-jre-alpine as production
1+
FROM openjdk:11-jre as production
22
ARG REVISION=dev
33
#
44
# Download grpc_health_probe to run health check for Feast Serving

0 commit comments

Comments
 (0)