35 lines
1.0 KiB
Docker
35 lines
1.0 KiB
Docker
# Create a virtual environment with all tools installed
|
|
# ref: https://hub.docker.com/_/ubuntu
|
|
FROM ubuntu:rolling AS env
|
|
|
|
# Install system build dependencies
|
|
ENV TZ=Europe/Paris
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
# Install system build dependencies
|
|
RUN apt update -qq \
|
|
&& apt install -yq git wget curl libssl-dev build-essential \
|
|
&& apt install -yq python3-dev python3-pip python3-venv \
|
|
python3-numpy python3-pandas \
|
|
&& apt install -yq default-jdk \
|
|
&& apt clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
# Install Bazelisk
|
|
ARG TARGETARCH=amd64
|
|
RUN wget \
|
|
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
|
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
|
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
|
|
|
FROM env AS devel
|
|
WORKDIR /home/project
|
|
COPY . .
|
|
|
|
FROM devel AS build
|
|
RUN bazel version
|
|
RUN bazel build --config=ci //ortools/... //examples/...
|
|
|
|
FROM build AS test
|
|
RUN bazel test --config=ci //ortools/... //examples/...
|