31 lines
814 B
Docker
31 lines
814 B
Docker
# Create a virtual environment with all tools installed
|
|
# ref: https://hub.docker.com/_/alpine
|
|
FROM alpine:edge AS env
|
|
|
|
# Install system build dependencies
|
|
ENV PATH=/usr/local/bin:$PATH
|
|
RUN apk add --no-cache \
|
|
git build-base linux-headers zlib-dev \
|
|
python3
|
|
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing bazel8
|
|
|
|
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
|
|
ENV PATH=$JAVA_HOME/bin:$PATH
|
|
|
|
# Install Python
|
|
RUN apk add --no-cache \
|
|
openssl python3-dev py3-pip py3-wheel py3-numpy py3-pandas
|
|
RUN python3 -m pip install --break-system-package \
|
|
absl-py mypy-protobuf
|
|
|
|
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/...
|