Skip to content

Commit

Permalink
tools/docker: Bring back Debian-10 (#3209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Mar 30, 2022
1 parent 54179bd commit 4ed047e
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/docker/Makefile
Expand Up @@ -75,6 +75,7 @@ help:
@echo -e "\t\t${BOLD}centos-8${RESET} (latest)"
@echo -e "\t\t${BOLD}centos-7${RESET} (Centos 7 LTS)"
@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-35${RESET} (latest)"
@echo -e "\t\t${BOLD}fedora-34${RESET}"
@echo -e "\t\t${BOLD}fedora-33${RESET}"
Expand Down Expand Up @@ -353,7 +354,7 @@ python: python_export
DISTROS = \
alpine-edge \
centos-7 centos-8 \
debian-11 \
debian-10 debian-11 \
fedora-33 fedora-34 fedora-35 \
opensuse-leap \
ubuntu-18.04 ubuntu-20.04 ubuntu-22.04
Expand Down
78 changes: 78 additions & 0 deletions tools/docker/amd64/debian-10.Dockerfile
@@ -0,0 +1,78 @@
# ref: https://hub.docker.com/_/debian
FROM debian:10 AS env

#############
## SETUP ##
#############
RUN apt-get update -qq \
&& apt-get install -qq \
git pkg-config wget make autoconf libtool zlib1g-dev gawk g++ curl subversion \
swig lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install CMake 3.21.1
RUN wget -q "https://cmake.org/files/v3.21/cmake-3.21.1-linux-x86_64.sh" \
&& chmod a+x cmake-3.21.1-linux-x86_64.sh \
&& ./cmake-3.21.1-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.21.1-linux-x86_64.sh

# Java Install
RUN apt-get update -qq \
&& apt-get install -qq default-jdk maven \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV JAVA_HOME=/usr/lib/jvm/default-java

# Dotnet Install
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-10-
RUN apt-get update -qq \
&& apt-get install -qq gpg apt-transport-https \
&& wget -q "https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb \
&& 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 clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

################
## OR-TOOLS ##
################
FROM env AS devel
# 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:-master}
ARG SRC_GIT_SHA1
ENV SRC_GIT_SHA1 ${SRC_GIT_SHA1:-unknown}

# Download sources
# use SRC_GIT_SHA1 to modify the command
# i.e. avoid docker reusing the cache when new commit is pushed
WORKDIR /root
RUN git clone -b "${SRC_GIT_BRANCH}" --single-branch https://github.com/google/or-tools \
&& echo "sha1: $(cd or-tools && git rev-parse --verify HEAD)" \
&& echo "expected sha1: ${SRC_GIT_SHA1}"

# Build third parties
FROM devel AS third_party
WORKDIR /root/or-tools
RUN make detect \
&& make third_party BUILD_PYTHON=OFF BUILD_JAVA=ON BUILD_DOTNET=ON

# Build project
FROM third_party AS build
RUN make detect_cc \
&& make detect_java \
&& make detect_dotnet
RUN make compile JOBS=4
15 changes: 15 additions & 0 deletions tools/docker/test/amd64/debian-10/cc.Dockerfile
@@ -0,0 +1,15 @@
FROM debian:10
LABEL maintainer="corentinl@google.com"

RUN apt-get update \
&& apt-get install -y -q build-essential zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#ENV TZ=America/Los_Angeles
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root
ADD or-tools_debian-10_v*.tar.gz .

RUN cd or-tools_*_v* && make test_cc
29 changes: 29 additions & 0 deletions tools/docker/test/amd64/debian-10/dotnet.Dockerfile
@@ -0,0 +1,29 @@
FROM debian:10
LABEL maintainer="corentinl@google.com"

RUN apt-get update \
&& apt-get install -y -q build-essential zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Dotnet Install
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-10-
RUN apt-get update -qq \
&& apt-get install -qq gpg apt-transport-https \
&& wget -q "https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb \
&& 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-5.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

#ENV TZ=America/Los_Angeles
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root
ADD or-tools_debian-10_v*.tar.gz .

RUN cd or-tools_*_v* && make test_dotnet
16 changes: 16 additions & 0 deletions tools/docker/test/amd64/debian-10/java.Dockerfile
@@ -0,0 +1,16 @@
FROM debian:10
LABEL maintainer="corentinl@google.com"

RUN apt-get update \
&& apt-get install -y -q build-essential zlib1g-dev default-jdk maven \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV JAVA_HOME=/usr/lib/jvm/default-java

#ENV TZ=America/Los_Angeles
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root
ADD or-tools_debian-10_v*.tar.gz .

RUN cd or-tools_*_v* && make test_java

0 comments on commit 4ed047e

Please sign in to comment.