release: Move from Ubuntu:18.04 to Centos:7

This commit is contained in:
Mizux Seiha
2021-04-23 14:50:08 +02:00
parent 01c85e527d
commit 57cc52ce86

View File

@@ -1,44 +1,55 @@
FROM ubuntu:18.04 AS env
FROM centos:7 AS env
#############
## SETUP ##
#############
RUN apt update -qq \
&& apt install -yq \
git pkg-config wget make autoconf libtool zlib1g-dev gawk g++ curl subversion \
lsb-release gpg openssl \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN yum -y update \
&& yum -y groupinstall 'Development Tools' \
&& yum -y install wget curl pcre-devel redhat-lsb-core pkgconfig autoconf libtool zlib-devel which \
&& yum clean all \
&& rm -rf /var/cache/yum
# Install CMake 3.19.7
RUN wget "https://cmake.org/files/v3.19/cmake-3.19.7-Linux-x86_64.sh" \
&& chmod a+x cmake-3.19.7-Linux-x86_64.sh \
&& ./cmake-3.19.7-Linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.19.7-Linux-x86_64.sh
# Bump to gcc-9
RUN yum -y update \
&& yum -y install centos-release-scl \
&& yum -y install devtoolset-9 \
&& yum clean all \
&& echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]
# RUN gcc --version
# Swig Install
RUN apt-get update -qq \
&& apt-get install -yq swig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install CMake 3.20.1
RUN wget "https://cmake.org/files/v3.20/cmake-3.20.1-linux-x86_64.sh" \
&& chmod a+x cmake-3.20.1-linux-x86_64.sh \
&& ./cmake-3.20.1-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.20.1-linux-x86_64.sh
# Java install (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 Swig 4.0.2
RUN curl --location-trusted \
--remote-name "https://downloads.sourceforge.net/project/swig/swig/swig-4.0.2/swig-4.0.2.tar.gz" \
-o swig-4.0.2.tar.gz \
&& tar xvf swig-4.0.2.tar.gz \
&& rm swig-4.0.2.tar.gz \
&& cd swig-4.0.2 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.0.2
# Dotnet Install
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1804
RUN apt-get update -qq \
&& apt-get install -yq apt-transport-https \
&& wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -yq dotnet-sdk-3.1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Java 8 SDK
RUN yum -y update \
&& yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \
&& yum clean all \
&& rm -rf /var/cache/yum
# Install dotnet
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos#centos-7-
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm \
&& yum -y update \
&& yum -y install dotnet-sdk-3.1 \
&& yum clean all \
&& rm -rf /var/cache/yum
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info