Skip to content

Commit d309955

Browse files
irozzo-1Apoiana
authored andcommitted
chore(images/builder): use vault centos repository
Signed-off-by: irozzo-1A <[email protected]>
1 parent 636611b commit d309955

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

images/builder/Dockerfile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
FROM centos:7
22

3+
# TARGETARCH is automatically set by BuildKit (arm64 or amd64)
4+
ARG TARGETARCH
5+
36
COPY /dhclient.service /usr/lib/systemd/system/
47

5-
RUN yum -y install centos-release-scl && \
6-
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ && \
7-
source /opt/rh/devtoolset-9/enable && \
8-
yum install -y \
8+
# Fix broken mirrors - centos:7 eol
9+
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo; \
10+
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo; \
11+
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
12+
13+
RUN yum -y install centos-release-scl
14+
15+
# fix broken mirrors (again)
16+
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo; \
17+
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo; \
18+
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo && \
19+
if [ "$TARGETARCH" != "amd64" ]; then \
20+
sed -i 's|vault.centos.org/centos/7/sclo|vault.centos.org/altarch/7/sclo|g' /etc/yum.repos.d/CentOS-SCLo-scl*.repo; \
21+
fi
22+
23+
RUN yum install -y \
924
cmake \
1025
curl \
1126
dhclient \
@@ -21,8 +36,12 @@ RUN yum -y install centos-release-scl && \
2136
rsync \
2237
systemd \
2338
tar \
24-
wget && \
25-
curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz && \
39+
wget \
40+
sed && \
41+
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ && \
42+
source /opt/rh/devtoolset-9/enable
43+
44+
RUN curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz && \
2645
gzip -d /tmp/cmake.tar.gz && \
2746
tar -xpf /tmp/cmake.tar --directory=/tmp && \
2847
cp -R /tmp/cmake-3.22.5-linux-$(uname -m)/* /usr && \

0 commit comments

Comments
 (0)