|
| 1 | +FROM centos:centos8 |
| 2 | + |
| 3 | +ARG USER_ID |
| 4 | +ARG GROUP_ID |
| 5 | + |
| 6 | +LABEL maintainer="Andrii Anpilogov (andrii.anpilogov@autodesk.com)" |
| 7 | + |
| 8 | +RUN [ -e /etc/yum.conf ] && sed -i '/tsflags=nodocs/d' /etc/yum.conf || true |
| 9 | + |
| 10 | +# RUN yum install -y icu |
| 11 | + |
| 12 | +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* |
| 13 | +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* |
| 14 | +RUN yum update -y |
| 15 | + |
| 16 | +RUN dnf -y install dnf-plugins-core |
| 17 | +RUN dnf -y install dnf-plugin-config-manager |
| 18 | +RUN dnf -y update |
| 19 | + |
| 20 | +RUN dnf -y install epel-release |
| 21 | +RUN dnf -y config-manager --set-enabled powertools |
| 22 | + |
| 23 | +# GCC |
| 24 | +RUN dnf -y install gcc-toolset-9-gcc |
| 25 | +RUN dnf -y install gcc-toolset-9-gcc-c++ |
| 26 | + |
| 27 | +# CMake & Ninja |
| 28 | +RUN dnf -y install cmake |
| 29 | +RUN dnf -y install ninja-build |
| 30 | + |
| 31 | +# Free Pascal |
| 32 | +# 3.0.4 should be used for validating compiler base compatibility. |
| 33 | +RUN (cd /opt && curl -O -L 'http://downloads.sourceforge.net/project/freepascal/Linux/3.0.4/fpc-3.0.4-1.x86_64.rpm' \ |
| 34 | + && rpm -i fpc-3.0.4-1.x86_64.rpm) |
| 35 | + |
| 36 | +# Using 3.2.2 until PolymorphicFactory is reworked to not using generics that are not full functional in 3.0.4. |
| 37 | +# RUN (cd /opt && curl -O -L 'http://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2-1.x86_64.rpm' \ |
| 38 | +# && rpm -i fpc-3.2.2-1.x86_64.rpm) |
| 39 | + |
| 40 | +# Golang |
| 41 | +RUN (cd /opt && curl -O -L https://golang.org/dl/go1.17.2.linux-amd64.tar.gz \ |
| 42 | + && tar zxvf go1.17.2.linux-amd64.tar.gz) |
| 43 | + |
| 44 | +# Java |
| 45 | +RUN dnf -y install \ |
| 46 | + java-11-openjdk-devel |
| 47 | + |
| 48 | +# Mono |
| 49 | +RUN rpm --import https://download.mono-project.com/repo/xamarin.gpg \ |
| 50 | + && dnf config-manager --add-repo https://download.mono-project.com/repo/centos8-stable.repo \ |
| 51 | + && dnf -y install mono-complete |
| 52 | + |
| 53 | +# General purpose tools |
| 54 | +RUN dnf -y install \ |
| 55 | + glibc-common \ |
| 56 | + glibc-utils \ |
| 57 | + less \ |
| 58 | + passwd \ |
| 59 | + tar \ |
| 60 | + vim-minimal \ |
| 61 | + vim-enhanced \ |
| 62 | + which \ |
| 63 | + sudo \ |
| 64 | + bash-completion \ |
| 65 | + mc \ |
| 66 | + yum-utils \ |
| 67 | + && yum clean all |
| 68 | + |
| 69 | +# # Initialize Toolkit |
| 70 | +RUN echo "source /opt/rh/gcc-toolset-9/enable" >> /etc/bashrc |
| 71 | +ENV PATH="${PATH}:/opt/go/bin" |
| 72 | + |
| 73 | +# Initialize Toolkit |
| 74 | +# RUN : "${USER_ID:?Build argument needs to be set and non-empty.}" \ |
| 75 | +# : "${GROUP_ID:?Build argument needs to be set and non-empty.}" |
| 76 | + |
| 77 | +# Create user |
| 78 | +RUN if [ $USER_ID != "" ] ; then groupadd docker \ |
| 79 | + && useradd -ms /bin/bash --uid $USER_ID -g docker -G wheel user \ |
| 80 | + && printf "user:user" | chpasswd \ |
| 81 | + && printf "user ALL= NOPASSWD: ALL\\n" >> /etc/sudoers ; fi |
| 82 | + |
| 83 | +# Initialize Toolkit |
| 84 | +RUN if [ $USER_ID != "" ] ; then echo "source /opt/rh/gcc-toolset-9/enable" >> /home/user/.bash_profile ; fi |
| 85 | +RUN if [ $USER_ID != "" ] ; then echo "export PATH=\$PATH:/opt/go/bin" >> /home/user/.bash_profile ; fi |
| 86 | + |
| 87 | +ENTRYPOINT ["./entrypoint.sh"] |
0 commit comments