Merge branch 'main' of github.com:google/or-tools

This commit is contained in:
Laurent Perron
2025-06-02 14:14:41 +02:00
24 changed files with 199 additions and 43 deletions

View File

@@ -96,6 +96,7 @@ help:
# @echo -e "\t\t${BOLD}debian-13${RESET} (Trixie)"
@echo -e "\t\t${BOLD}debian-12${RESET} (Bookworm)"
@echo -e "\t\t${BOLD}debian-11${RESET} (Bullseye)"
@echo -e "\t\t${BOLD}fedora-42${RESET}"
@echo -e "\t\t${BOLD}fedora-41${RESET}"
@echo -e "\t\t${BOLD}fedora-40${RESET}"
@echo -e "\t\t${BOLD}opensuse-leap${RESET} (latest)"
@@ -115,7 +116,7 @@ help:
@echo
@echo -e "\t${BOLD}<lang>${RESET}: Language to build"
@echo -e "\t\t${BOLD}cpp${RESET} C++"
@echo -e "\t\t${BOLD}dotnet${RESET} .Net Core 3.1 and/or .Net 6.0 wrappers"
@echo -e "\t\t${BOLD}dotnet${RESET} .Net Core 3.1 and/or .Net 8.0 wrappers"
@echo -e "\t\t${BOLD}java${RESET} Java (JDK 8.0) wrappers"
@echo -e "\t\t${BOLD}python${RESET} Python 3.9+ wrappers"
@echo
@@ -431,7 +432,7 @@ DISTROS := \
alpine-edge \
archlinux \
debian-11 debian-12 debian-sid \
fedora-40 fedora-41 \
fedora-40 fedora-41 fedora-42 \
opensuse-leap \
rockylinux-9 \
ubuntu-20.04 ubuntu-22.04 ubuntu-24.04 ubuntu-24.10

View File

@@ -33,7 +33,7 @@ RUN dnf -y update \
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -25,7 +25,7 @@ RUN ARCH=$(uname -m) \
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -18,7 +18,7 @@ CMD ["/bin/bash"]
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -18,7 +18,7 @@ CMD ["/bin/bash"]
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -25,7 +25,7 @@ RUN apt-get update -qq \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-6.0 \
&& apt-get install -qq dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -0,0 +1,102 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:42 AS env
#############
## SETUP ##
#############
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]
# Install SWIG
RUN dnf -y update \
&& dnf -y install swig \
&& dnf clean all
# Install .Net
# see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-fedora
RUN dnf -y update \
&& dnf -y install dotnet-sdk-8.0 crypto-policies-scripts \
&& dnf clean all
# https://docs.redhat.com/en/documentation/net/6.0/html/release_notes_for_.net_6.0_rpm_packages/known-issues_release-notes-for-dotnet-rpms
RUN update-crypto-policies --set DEFAULT:SHA1
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
# Install Java
RUN dnf -y update \
&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \
&& dnf clean all
ENV JAVA_HOME=/usr/lib/jvm/java-openjdk
# Install Python
RUN dnf -y update \
&& dnf -y install python3 python3-devel python3-pip \
&& dnf clean all
RUN python3 -m pip install absl-py mypy mypy-protobuf
################
## OR-TOOLS ##
################
FROM env AS devel
WORKDIR /root
# Copy the snk key
COPY or-tools.snk /root/or-tools.snk
ENV DOTNET_SNK=/root/or-tools.snk
ARG SRC_GIT_BRANCH
ENV SRC_GIT_BRANCH ${SRC_GIT_BRANCH:-main}
ARG SRC_GIT_SHA1
ENV SRC_GIT_SHA1 ${SRC_GIT_SHA1:-unknown}
ARG OR_TOOLS_PATCH
ENV OR_TOOLS_PATCH ${OR_TOOLS_PATCH:-9999}
# Download sources
# use SRC_GIT_SHA1 to modify the command
# i.e. avoid docker reusing the cache when new commit is pushed
RUN git clone -b "${SRC_GIT_BRANCH}" --single-branch --depth=1 https://github.com/google/or-tools \
&& [[ $(cd or-tools && git rev-parse --verify HEAD) == ${SRC_GIT_SHA1} ]]
WORKDIR /root/or-tools
# C++
## build
FROM devel AS cpp_build
RUN make detect_cpp \
&& make cpp JOBS=8
## archive
FROM cpp_build AS cpp_archive
RUN make archive_cpp
# .Net
## build
FROM cpp_build AS dotnet_build
ENV USE_DOTNET_CORE_31=ON
RUN make detect_dotnet \
&& make dotnet JOBS=8
## archive
FROM dotnet_build AS dotnet_archive
RUN make archive_dotnet
# Java
## build
FROM cpp_build AS java_build
RUN make detect_java \
&& make java JOBS=8
## archive
FROM java_build AS java_archive
RUN make archive_java
# Python
## build
FROM cpp_build AS python_build
RUN make detect_python \
&& make python JOBS=8
## archive
FROM python_build AS python_archive
RUN make archive_python

View File

@@ -26,7 +26,7 @@ RUN zypper refresh \
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -33,7 +33,7 @@ RUN dnf -y update \
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -33,7 +33,7 @@ RUN apt-get update -qq \
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -24,7 +24,7 @@ RUN apt-get update -qq \
# see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
# see: https://github.com/dotnet/core/pull/7423/files
RUN apt-get update -qq \
&& apt-get install -yq dotnet-sdk-6.0 \
&& apt-get install -yq dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -13,7 +13,7 @@ RUN dnf -y update \
# Install .Net
RUN dnf -y update \
&& dnf -y install dotnet-sdk-6.0 \
&& dnf -y install dotnet-sdk-8.0 \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Trigger first run experience by running arbitrary cmd

View File

@@ -14,7 +14,7 @@ RUN apt-get update -qq \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -14,7 +14,7 @@ RUN apt-get update -qq \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -14,7 +14,7 @@ RUN apt-get update -qq \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -14,7 +14,7 @@ RUN apt-get update -qq \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -0,0 +1,14 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:42
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-42_cpp_v*.tar.gz .
RUN cd or-tools_*_v* && make test

View File

@@ -0,0 +1,22 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:42
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
# Install .Net
# see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-fedora
RUN dnf -y update \
&& dnf -y install dotnet-sdk-8.0 \
&& dnf clean all
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
WORKDIR /root
ADD or-tools_amd64_fedora-42_dotnet_v*.tar.gz .
RUN cd or-tools_*_v* && make test

View File

@@ -0,0 +1,20 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:42
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
# Java Install
RUN dnf -y update \
&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \
&& dnf clean all
ENV JAVA_HOME=/usr/lib/jvm/java-openjdk
WORKDIR /root
ADD or-tools_amd64_fedora-42_java_v*.tar.gz .
RUN cd or-tools_*_v* && make test

View File

@@ -0,0 +1,14 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:42
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y install @development-tools \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-42_python_v*.tar.gz .
RUN cd or-tools_*_v* && make test

View File

@@ -13,30 +13,13 @@ ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]
# .Net Install
RUN zypper install -y wget tar gzip libicu-devel
RUN mkdir -p /usr/share/dotnet \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# see: https://dotnet.microsoft.com/download/dotnet-core/3.1
RUN dotnet_sdk_version=3.1.415 \
&& wget -qO dotnet.tar.gz \
"https://builds.dotnet.microsoft.com/dotnet/Sdk/${dotnet_sdk_version}/dotnet-sdk-${dotnet_sdk_version}-linux-x64.tar.gz" \
&& dotnet_sha512='df7a6d1abed609c382799a8f69f129ec72ce68236b2faecf01aed4c957a40a9cfbbc9126381bf517dff3dbe0e488f1092188582701dd0fef09a68b8c5707c747' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \
&& rm dotnet.tar.gz
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
# see: https://dotnet.microsoft.com/download/dotnet-core/6.0
RUN dotnet_sdk_version=6.0.100 \
&& wget -qO dotnet.tar.gz \
"https://builds.dotnet.microsoft.com/dotnet/Sdk/${dotnet_sdk_version}/dotnet-sdk-${dotnet_sdk_version}-linux-x64.tar.gz" \
&& dotnet_sha512='cb0d174a79d6294c302261b645dba6a479da8f7cf6c1fe15ae6998bc09c5e0baec810822f9e0104e84b0efd51fdc0333306cb2a0a6fcdbaf515a8ad8cf1af25b' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \
&& rm dotnet.tar.gz
RUN zypper refresh \
&& zypper install -y wget tar gzip libicu-devel
# see: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
RUN wget -q "https://dot.net/v1/dotnet-install.sh" \
&& chmod a+x dotnet-install.sh \
&& ./dotnet-install.sh -c 3.1 -i /usr/local/bin \
&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

View File

@@ -13,7 +13,7 @@ RUN dnf -y update \
# Install .Net
RUN dnf -y update \
&& dnf -y install dotnet-sdk-6.0 \
&& dnf -y install dotnet-sdk-8.0 \
&& dnf clean all \
&& rm -rf /var/cache/dnf
# Trigger first run experience by running arbitrary cmd

View File

@@ -14,7 +14,7 @@ RUN apt-get update -qq \
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd

View File

@@ -10,7 +10,7 @@ RUN apt-get update -qq \
# Install .Net
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2110-
RUN apt-get update -qq \
&& apt-get install -yq dotnet-sdk-6.0 \
&& apt-get install -yq dotnet-sdk-8.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd