tools/docker: Add Fedora37 and Fedora38 support

This commit is contained in:
Corentin Le Molgat
2023-02-06 11:13:28 +01:00
committed by Mizux Seiha
parent cae5e06212
commit b44a6cd79a
11 changed files with 341 additions and 3 deletions

View File

@@ -97,12 +97,14 @@ help:
@echo -e "\t\t${BOLD}debian-sid${RESET} (unstable)"
@echo -e "\t\t${BOLD}debian-11${RESET} (bullseye, latest)"
@echo -e "\t\t${BOLD}debian-10${RESET} (buster)"
@echo -e "\t\t${BOLD}fedora-36${RESET} (latest)"
@echo -e "\t\t${BOLD}fedora-38${RESET} (rawhide)"
@echo -e "\t\t${BOLD}fedora-37${RESET} (latest)"
@echo -e "\t\t${BOLD}fedora-36${RESET}"
@echo -e "\t\t${BOLD}fedora-35${RESET}"
@echo -e "\t\t${BOLD}fedora-34${RESET}"
@echo -e "\t\t${BOLD}fedora-33${RESET}"
@echo -e "\t\t${BOLD}opensuse-leap${RESET} (latest)"
@echo -e "\t\t${BOLD}ubuntu-22.10${RESET} (Ubuntu 22.10, devel)"
@echo -e "\t\t${BOLD}ubuntu-22.10${RESET} (Ubuntu 22.10, rolling)"
@echo -e "\t\t${BOLD}ubuntu-22.04${RESET} (Ubuntu 22.04 LTS, latest)"
@echo -e "\t\t${BOLD}ubuntu-20.04${RESET} (Ubuntu 20.04 LTS)"
@echo -e "\t\t${BOLD}ubuntu-18.04${RESET} (Ubuntu 18.04 LTS)"
@@ -406,7 +408,7 @@ DISTROS := \
archlinux \
centos-7 centos-8 \
debian-10 debian-11 debian-sid \
fedora-33 fedora-34 fedora-35 fedora-36 \
fedora-33 fedora-34 fedora-35 fedora-36 fedora-37 fedora-38 \
opensuse-leap \
ubuntu-18.04 ubuntu-20.04 ubuntu-22.04 ubuntu-22.10

View File

@@ -0,0 +1,98 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:37 AS env
#############
## SETUP ##
#############
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-3.1 dotnet-sdk-6.0 \
&& dnf clean all
# 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
################
## 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
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

@@ -0,0 +1,98 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:38 AS env
#############
## SETUP ##
#############
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-3.1 dotnet-sdk-6.0 \
&& dnf clean all
# 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
################
## 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
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

@@ -0,0 +1,14 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:37
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-37_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:37
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-3.1 dotnet-sdk-6.0 \
&& dnf clean all
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
WORKDIR /root
ADD or-tools_amd64_fedora-37_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:37
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-37_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:37
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-37_python_v*.tar.gz .
RUN cd or-tools_*_v* && make test

View File

@@ -0,0 +1,14 @@
# ref: https://hub.docker.com/_/fedora
FROM fedora:38
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-38_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:38
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-3.1 dotnet-sdk-6.0 \
&& dnf clean all
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
WORKDIR /root
ADD or-tools_amd64_fedora-38_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:38
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "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-38_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:38
RUN dnf -y update \
&& dnf -y install git \
wget which redhat-lsb-core pkgconfig autoconf libtool zlib-devel \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ cmake \
&& dnf clean all
WORKDIR /root
ADD or-tools_amd64_fedora-38_python_v*.tar.gz .
RUN cd or-tools_*_v* && make test