Routing use c++17 features (e.g. structured binding) ref: https://en.cppreference.com/w/cpp/language/structured_binding
31 lines
1.1 KiB
Docker
31 lines
1.1 KiB
Docker
# Create a virtual environment with all tools installed
|
|
# ref: https://hub.docker.com/_/debian
|
|
FROM debian:latest AS env
|
|
LABEL maintainer="corentinl@google.com"
|
|
# Install system build dependencies
|
|
ENV PATH=/usr/local/bin:$PATH
|
|
RUN apt-get update -qq \
|
|
&& apt-get install -yq git wget curl libssl-dev build-essential \
|
|
&& apt-get install -yq python3-dev python3-pip \
|
|
&& apt-get install -yq default-jdk \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
# Install Bazel
|
|
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
|
|
RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
|
RUN apt-get update -qq \
|
|
&& apt-get install -yq bazel \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
CMD [ "/bin/bash" ]
|
|
|
|
FROM env AS devel
|
|
WORKDIR /home/lib
|
|
COPY . .
|
|
|
|
FROM devel as build
|
|
RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all
|
|
|
|
FROM build as test
|
|
RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all
|