FROM python:3.7

ARG version
ARG revision

LABEL revision=${revision}

RUN apt-get install autoconf automake libtool curl make g++ unzip && \
    cd /tmp && \
    wget https://github.com/protocolbuffers/protobuf/releases/download/v${version}/protobuf-cpp-${version}.tar.gz && \
    tar zxvf protobuf-cpp-${version}.tar.gz && \
    cd protobuf-${version} && \
    ./autogen.sh && \
    ./configure --prefix=/usr/ && \
    make && \
    make check && \
    make install && \
    ldconfig && \
    cd .. && rm -rf protobuf-${version} && rm protobuf-cpp-${version}.tar.gz
