-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.proto
34 lines (29 loc) · 1 KB
/
Dockerfile.proto
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
ARG BASE_TAG=22.04
FROM ubuntu:${BASE_TAG} as build-stage
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
autoconf \
cmake \
g++ \
gcc \
libtool \
make \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
ARG PROTOBUF_VERSION=21.0
RUN wget -O protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz \
https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-3.${PROTOBUF_VERSION}.tar.gz \
&& tar -xzf protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz \
&& rm protobuf-cpp-"${PROTOBUF_VERSION}".tar.gz
WORKDIR /tmp/protobuf-3."${PROTOBUF_VERSION}"
RUN ./autogen.sh \
&& ./configure \
&& make -j $(nproc --ignore=1) \
&& make install
FROM ubuntu:${BASE_TAG} as google-dependencies
COPY --from=build-stage /usr/local/include/google /usr/local/include/google
COPY --from=build-stage /usr/local/lib/libproto* /usr/local/lib/
COPY --from=build-stage /usr/local/bin/protoc /usr/local/bin
RUN ldconfig