Skip to content

Commit c1a3f6e

Browse files
authored
Update RHEL7/Centos7/OracleLinux7 dockerfiles (#829)
- 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.
1 parent 033f3b7 commit c1a3f6e

File tree

6 files changed

+76
-14
lines changed

6 files changed

+76
-14
lines changed

devops/docker/centos-7-amd64/Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# TODO: Add mcr.io retagged images
22
FROM centos:7
33

4+
RUN rm /etc/yum.repos.d/*.repo
5+
COPY centos.repo /etc/yum.repos.d/centos.repo
6+
47
RUN yum install -y \
58
autoconf \
69
gcc \
@@ -19,10 +22,10 @@ WORKDIR /git
1922
RUN git clone https://github.com/Kitware/CMake --recursive -b v3.21.7
2023
RUN cd CMake && ./bootstrap && make -j$(nproc) && make install && hash -r && rm -rf /git/CMake
2124

25+
# rapidjson
26+
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
27+
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
28+
2229
# GTest
2330
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
2431
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest
25-
26-
# rapidjson
27-
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
28-
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[base]
2+
name=CentOS-$releasever - Base
3+
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
4+
enabled=1
5+
gpgcheck=1
6+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
7+
8+
#released updates
9+
[updates]
10+
name=CentOS-$releasever - Updates
11+
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
12+
enabled=1
13+
gpgcheck=1
14+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
15+
16+
#additional packages that may be useful
17+
[extras]
18+
name=CentOS-$releasever - Extras
19+
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
20+
enabled=1
21+
gpgcheck=1
22+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

devops/docker/oraclelinux-7-amd64/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ WORKDIR /git
1919
RUN git clone https://github.com/Kitware/CMake --recursive -b v3.21.7
2020
RUN cd CMake && ./bootstrap && make -j$(nproc) && make install && hash -r && rm -rf /git/CMake
2121

22+
# rapidjson
23+
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
24+
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
25+
2226
# GTest
2327
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
2428
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest
25-
26-
# rapidjson
27-
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
28-
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson

devops/docker/rhel-7-amd64/Dockerfile

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# ubi7 images are missing RPM devtools, copy from centos7
22
FROM centos:centos7 as centos
3-
RUN yum update -y && yumdownloader rpm-build && yumdownloader elfutils
3+
RUN rm /etc/yum.repos.d/*.repo
4+
COPY centos.repo /etc/yum.repos.d/centos.repo
5+
6+
RUN yum update -y
7+
RUN rm /etc/yum.repos.d/*.repo
8+
COPY centos.repo /etc/yum.repos.d/centos.repo
9+
10+
RUN yumdownloader rpm-build && yumdownloader elfutils
411

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

37+
# rapidjson
38+
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
39+
RUN cd rapidjson && cmake -DRAPIDJSON_BUILD_TESTS=0 . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
40+
3041
# GTest
3142
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
3243
RUN cd googletest && cmake . && cmake --build . --parallel --target install && rm -rf /git/googletest
3344

34-
# rapidjson
35-
RUN git clone https://github.com/Tencent/rapidjson --recursive -b v1.1.0
36-
RUN cd rapidjson && cmake . && cmake --build . --parallel --target install && rm -rf /git/rapidjson
37-
3845
# elfutils
3946
RUN yum install -y /elfutils.rpm && rm -f /elfutils.rpm
4047

4148
# rpm-build
42-
RUN yum install -y /rpm-build.rpm && rm -f /rpm-build.rpm
49+
RUN yum install -y /rpm-build.rpm && rm -f /rpm-build.rpm
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[base]
2+
name=CentOS-$releasever - Base
3+
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
4+
enabled=1
5+
gpgcheck=1
6+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
7+
8+
#released updates
9+
[updates]
10+
name=CentOS-$releasever - Updates
11+
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
12+
enabled=1
13+
gpgcheck=1
14+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
15+
16+
#additional packages that may be useful
17+
[extras]
18+
name=CentOS-$releasever - Extras
19+
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
20+
enabled=1
21+
gpgcheck=1
22+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ghcr.io/azure/azure-osconfig/ubuntu-14.04-amd64:latest
2+
3+
RUN apt-get install -y ninja-build
4+
5+
WORKDIR /git
6+
7+
RUN git clone https://github.com/google/googletest --recursive -b release-1.10.0
8+
RUN cd googletest && cmake . -G Ninja && cmake --build . --target install && rm -rf /git/googletest

0 commit comments

Comments
 (0)