Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
FROM centos:centos7.9.2009
# Update for deprecated Centos7 mirrors
RUN sed -i 's|enabled=1|enabled=0|g' /etc/yum/pluginconf.d/fastestmirror.conf
RUN sed -i 's|^mirrorlist=http|#mirrorlist=http|g' /etc/yum.repos.d/CentOS-*.repo
RUN sed -i 's|^#.*baseurl=http|baseurl=http|g' /etc/yum.repos.d/CentOS-*.repo
RUN sed -i 's|.*baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=http://archive.kernel.org/centos-vault/7.9.2009|g' /etc/yum.repos.d/CentOS-*.repo
# Install common devel packages
RUN yum install --nogpgcheck --setopt=tsflags=nodocs -y -q \
autoconf automake bash bc binutils bison bzip2 cpio \
dtc expat-devel file flex gawk gcc gcc-c++ git gmp-devel gzip gtkwave \
java-11-openjdk-headless libmpc-devel libuuid-devel make mpfr-devel \
patch patchutils perl perl-ExtUtils-MakeMaker rsync \
sed tar tcl tcl-devel tk tk-devel texinfo unzip vim vim-common virtualenv which zlib-devel \
help2man readline-devel libreadline-devel libffi-devel wget bzip2 bzip2-devel python-pip \
python-devel python3-devel openssl-devel openssl11 openssl11-devel openssl11-libs \
epel-release centos-release-scl scl-utils \
bzip2 bzip2-devel sqlite-devel \
tcsh time perl-Env \
libXext libXrender libXtst libXi libXrandr libXScrnSaver \
libSM compat-libtiff3 libmng libpng12 \
&& yum clean all && rm -rf /var/cache/yum
# Same thing for SCL mirrors
RUN sed -i 's|^mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|^#baseurl=http://mirror.centos.org/centos/7|baseurl=http://vault.epel.cloud/7.9.2009|g' /etc/yum.repos.d/CentOS-SCLo-*
RUN sed -i 's|^# baseurl=http://mirror.centos.org/centos/7|baseurl=http://vault.epel.cloud/7.9.2009|g' /etc/yum.repos.d/CentOS-SCLo-*
# Install EPEL modules
RUN yum install --nogpgcheck --setopt=tsflags=nodocs -y -q \
devtoolset-11 rh-git218 openssl11 openssl11-devel openssl11-libs \
&& yum clean all && rm -rf /var/cache/yum
# Install autotools
RUN mkdir /build && cd /build && \
wget -qO- https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz | tar xz --strip-components=1 && \
./configure --prefix=/opt/autotools && make -j4 install && \
rm -rf /build
RUN mkdir /build && cd /build && \
wget -qO- https://ftp.gnu.org/gnu/libtool/libtool-2.5.3.tar.gz | tar xz --strip-components=1 && \
./configure --prefix=/opt/autotools && make -j4 install && \
rm -rf /build
RUN mkdir /build && cd /build && \
wget -qO- https://ftp.gnu.org/gnu/automake/automake-1.17.tar.gz | tar xz --strip-components=1 && \
./configure --prefix=/opt/autotools && make -j4 install && \
rm -rf /build
RUN mkdir /build && cd /build && \
wget -qO- https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz | tar xz --strip-components=1 && \
./configure --prefix=/opt/autotools && make -j4 install && \
rm -rf /build
# Install boost
RUN mkdir /build && cd /build && \
wget -qO- https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.gz | tar xz --strip-components=1 && \
./bootstrap.sh --prefix=/opt/boost && ./b2 --prefix=/opt/boost toolset=gcc install && \
rm -rf /build
# Install cmake
RUN mkdir /build && cd /build && \
wget -qO- https://cmake.org/files/v3.22/cmake-3.22.3.tar.gz | tar xz --strip-components=1 && \
./bootstrap --prefix=/opt/cmake && make -j4 install && \
rm -rf /build
# Install modern python
RUN mkdir /build && cd /build && \
wget -qO- https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz | tar xz --strip-components=1 && \
sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure && \
scl enable devtoolset-11 -- bash -c "\
cd /build && \
./configure --prefix=/opt/python \
--enable-loadable-sqlite-extensions \
--enable-optimizations \
--with-lto && \
make -j4 all && \
make -j4 altinstall \
" && \
rm -rf /build
## Accept arguments for user and group
ARG USER_NAME
ARG USER_ID
ARG GROUP_NAME
ARG GROUP_ID
ARG OTHER_GROUPS
ARG WORKDIR=/work
# Only create the group if it doesn't exist
RUN getent group $GROUP_ID || groupadd --gid $GROUP_ID $GROUP_NAME
# Use --no-log-init to deal with large userids creating giant log files
RUN useradd --no-log-init --uid $USER_ID --gid $GROUP_ID --home-dir $WORKDIR $USER_NAME
# Add the user to other groups
RUN for gid in ${OTHER_GROUPS}; do \
echo "group$gid"; \
groupadd -g $gid "group$gid" || true; \
usermod -aG "group$gid" $USER_NAME; \
done
# Create directory for extra installation
RUN mkdir -p /opt && chgrp $GROUP_NAME /opt && chmod 775 /opt
# Create custom entrypoint script
COPY entrypoint.centos7.sh /usr/bin/entrypoint.sh
RUN chmod +x /usr/bin/entrypoint.sh
# Create the default workdir
RUN mkdir -p ${WORKDIR}
RUN chown ${USER_NAME} ${WORKDIR}
# Set the default workdir
WORKDIR $WORKDIR
# Set the current user
USER $USER_NAME
# Create a python virtualenv
ENV VIRTUAL_ENV=/opt/venv
RUN /opt/python/bin/python3.12 -m venv $VIRTUAL_ENV
COPY requirements.txt /opt/venv/
RUN /opt/venv/bin/pip install -r /opt/venv/requirements.txt
# Kick off with bash
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
CMD ["/bin/bash"]
563ab6561This file is pinned to the selected release. Download the original to open it in your design tool.