Skip to content

Commit

Permalink
Update RHEL7/Centos7/OracleLinux7 dockerfiles (#829)
Browse files Browse the repository at this point in the history
- Rapidjson has a google test submodule that it installs. This module is
  incompatible with our usage of google test, and conflicts with the version
  that we clone ourselves. Disable installations of rapidjson's googletest and
  reorder to ensure google test is built last.
- Centos 7 mirror lists have been decommissioned but we can still access a snapshot
  of the repo - we just have to overwrite the repo definitions.
  • Loading branch information
jepio authored Dec 5, 2024
1 parent 033f3b7 commit c1a3f6e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 14 deletions.
11 changes: 7 additions & 4 deletions devops/docker/centos-7-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# TODO: Add mcr.io retagged images
FROM centos:7

RUN rm /etc/yum.repos.d/*.repo
COPY centos.repo /etc/yum.repos.d/centos.repo

RUN yum install -y \
autoconf \
gcc \
Expand All @@ -19,10 +22,10 @@ WORKDIR /git
RUN git clone https://github.com/Kitware/CMake --recursive -b v3.21.7
RUN cd CMake && ./bootstrap && make -j$(nproc) && make install && hash -r && rm -rf /git/CMake

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson

# GTest
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
22 changes: 22 additions & 0 deletions devops/docker/centos-7-amd64/centos.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
8 changes: 4 additions & 4 deletions devops/docker/oraclelinux-7-amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ WORKDIR /git
RUN git clone https://github.com/Kitware/CMake --recursive -b v3.21.7
RUN cd CMake && ./bootstrap && make -j$(nproc) && make install && hash -r && rm -rf /git/CMake

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson

# GTest
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
19 changes: 13 additions & 6 deletions devops/docker/rhel-7-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# ubi7 images are missing RPM devtools, copy from centos7
FROM centos:centos7 as centos
RUN yum update -y && yumdownloader rpm-build && yumdownloader elfutils
RUN rm /etc/yum.repos.d/*.repo
COPY centos.repo /etc/yum.repos.d/centos.repo

RUN yum update -y
RUN rm /etc/yum.repos.d/*.repo
COPY centos.repo /etc/yum.repos.d/centos.repo

RUN yumdownloader rpm-build && yumdownloader elfutils

# TODO: Add mcr.io retagged images
FROM registry.access.redhat.com/ubi7/ubi
Expand All @@ -27,16 +34,16 @@ RUN cd CMake && ./bootstrap && make -j$(nproc) && make install && hash -r && rm
RUN git clone https://github.com/stedolan/jq.git --recursive
RUN cd jq && autoreconf -i && ./configure && make -j$(nproc) && make install && rm -rf /git/jq

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson

# GTest
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest

# rapidjson
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson

# elfutils
RUN yum install -y /elfutils.rpm && rm -f /elfutils.rpm

# rpm-build
RUN yum install -y /rpm-build.rpm && rm -f /rpm-build.rpm
RUN yum install -y /rpm-build.rpm && rm -f /rpm-build.rpm
22 changes: 22 additions & 0 deletions devops/docker/rhel-7-amd64/centos.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
8 changes: 8 additions & 0 deletions devops/docker/ubuntu-14.04-amd64/Dockerfile.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/azure/azure-osconfig/ubuntu-14.04-amd64:latest

RUN apt-get install -y ninja-build

WORKDIR /git

RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
RUN cd googletest && cmake . -G Ninja && cmake --build . --target install && rm -rf /git/googletest

0 comments on commit c1a3f6e

Please sign in to comment.