Skip to content

Commit

Permalink
tools/docker: add Ubuntu-23.04 archive
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jul 21, 2023
1 parent 13f587f commit 4f97813
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ help:
@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, rolling)"
@echo -e "\t\t${BOLD}ubuntu-23.04${RESET} (Ubuntu 23.04, rolling)"
@echo -e "\t\t${BOLD}ubuntu-22.10${RESET} (Ubuntu 22.10)"
@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)"
Expand Down Expand Up @@ -409,7 +410,7 @@ DISTROS := \
debian-10 debian-11 debian-sid \
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
ubuntu-18.04 ubuntu-20.04 ubuntu-22.04 ubuntu-22.10 ubuntu-23.04

# List of stages
STAGES := env devel
Expand Down
108 changes: 108 additions & 0 deletions tools/docker/images/ubuntu-23.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:23.04 AS env

#############
## SETUP ##
#############
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -qq \
&& apt install -yq git wget build-essential cmake lsb-release zlib1g-dev \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install SWIG
RUN apt-get update -qq \
&& apt-get install -yq swig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install .Net
# 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 clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

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

# Install Python
RUN apt-get update -qq \
&& apt-get install -qq python3 python3-dev python3-pip python3-venv \
&& 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

################
## 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
SHELL ["/bin/bash", "-c"]
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=OFF
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
13 changes: 13 additions & 0 deletions tools/docker/test/ubuntu-23.04/cpp.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:23.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -yq build-essential cmake zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /root
ADD or-tools_amd64_ubuntu-23.04_cpp_v*.tar.gz .

RUN cd or-tools_*_v* && make test
25 changes: 25 additions & 0 deletions tools/docker/test/ubuntu-23.04/dotnet.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:23.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -yq build-essential zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# 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 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_amd64_ubuntu-23.04_dotnet_v*.tar.gz .

RUN cd or-tools_*_v* && make test
21 changes: 21 additions & 0 deletions tools/docker/test/ubuntu-23.04/java.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:23.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -yq build-essential zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

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

WORKDIR /root
ADD or-tools_amd64_ubuntu-23.04_java_v*.tar.gz .

RUN cd or-tools_*_v* && make test
13 changes: 13 additions & 0 deletions tools/docker/test/ubuntu-23.04/python.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:23.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -yq make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /root
ADD or-tools_amd64_ubuntu-23.04_python_v*.tar.gz .

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

0 comments on commit 4f97813

Please sign in to comment.