Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (37 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (37 loc) · 1.62 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
41
42
43
44
45
46
47
48
49
FROM golang:1.26-trixie AS builder
ENV GOTOOLCHAIN=auto
# Update the package list and install the ca-certificates package
RUN apt-get update && apt-get install -y ca-certificates
RUN apt install -y protobuf-compiler
RUN go install google.golang.org/protobuf/cmd/[email protected]
RUN go install google.golang.org/grpc/cmd/[email protected]
# Set the current working directory inside the container
WORKDIR /app
# Copy the source code into the container
COPY go/ ./go/
COPY go.mod go.sum ./
# Compile Protobuf files
COPY protos/ ./protos/
RUN mkdir -p go/protos
RUN find ./protos -name "*.proto" \
-exec protoc --proto_path=protos --go_out=go/protos --go_opt=module=github.com/feast-dev/feast/go/protos --go-grpc_out=go/protos --go-grpc_opt=module=github.com/feast-dev/feast/go/protos {} \;
# Build the Go application
RUN go build -o feast ./go/main.go
# Ship only the server binary on a slim base, so the Go toolchain, compilers and
# kernel headers of the build image are not part of the published image. The
# runtime uses the same Debian release as the builder, so the cgo-linked binary
# finds a matching glibc.
FROM debian:trixie-slim
# Update the package list, install ca-certificates and libbrotli1 (patched
# version addressing DSA-6582-1).
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libbrotli1 \
&& rm -rf /var/lib/apt/lists/*
# Set the current working directory inside the container
WORKDIR /app
COPY --from=builder /app/feast ./feast
# Expose ports
EXPOSE 8080
# Command to run the executable
# Pass arguments to the executable (Ex: ./feast --type=grpc)
CMD ["./feast"]