-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·50 lines (36 loc) · 1.4 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env -S docker build --build-arg VERSION="1.5.0" --tag "fboranek/grpc-server:1.5.0" . -f
#########################################################
# Build deb stage
#########################################################
FROM debian:bookworm AS build
RUN apt-get update \
&& apt-get --assume-yes install \
build-essential cmake pkg-config debhelper libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
libboost-program-options-dev
WORKDIR /tmp/
COPY . /tmp/
# to install own libgrpc packages
RUN apt --assume-yes install ./extra_debs/bin/*.deb || true
RUN apt --assume-yes install ./extra_debs/dev/*.deb || true
RUN dpkg-buildpackage -j4
# output:
# /grpc-server_1.1.0_amd64.deb
# /grpc-client_1.1.0_amd64.deb
#########################################################
# Build docker stage
#########################################################
FROM debian:bookworm
ARG VERSION
LABEL \
org.label-schema.version="${VERSION}"
COPY --from=build /grpc-server_${VERSION}_amd64.deb /deb/
COPY --from=build /grpc-client_${VERSION}_amd64.deb /deb/
COPY --from=build /tmp/extra_debs/bin /extra_debs/
RUN apt-get update \
&& (apt --assume-yes install /extra_debs/*.deb || true) \
&& apt-get --assume-yes install /deb/grpc-server_${VERSION}_amd64.deb \
&& apt-get --assume-yes install /deb/grpc-client_${VERSION}_amd64.deb \
&& rm -rf /extra_debs \
&& rm -rf /deb
EXPOSE 8442
CMD [ "/opt/grpc/bin/grpc-server" ]