Skip to content

Commit

Permalink
Unify CentOS mirror configuration, add it to test container also (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans authored Jul 3, 2024
1 parent f200345 commit d606c88
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 29 deletions.
13 changes: 8 additions & 5 deletions integration/linux/build/Dockerfile-centos.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ ENV LANG en_US.UTF-8

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \
&& source /etc/os-release; \
[ "$VERSION_ID" = "7" -o "$VERSION_ID" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y

# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small.
Expand Down
15 changes: 9 additions & 6 deletions integration/linux/build/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ ENV LANG en_US.UTF-8

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \
&& source /etc/os-release; \
[ "$VERSION_ID" = "7" -o "$VERSION_ID" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y

# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small.
Expand Down Expand Up @@ -188,7 +191,7 @@ RUN cd /usr/local/bin \
&& ln -s python3-config python-config

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 24.0
ENV PYTHON_PIP_VERSION 24.1.1

RUN set -ex; \
\
Expand Down
15 changes: 9 additions & 6 deletions integration/linux/build/centos-8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ ENV LANG en_US.UTF-8

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

RUN (echo precedence ::ffff:0:0/96 100 >> /etc/gai.conf \
&& source /etc/os-release; \
[ "$VERSION_ID" = "7" -o "$VERSION_ID" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y

# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small.
Expand Down Expand Up @@ -188,7 +191,7 @@ RUN cd /usr/local/bin \
&& ln -s python3-config python-config

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 24.0
ENV PYTHON_PIP_VERSION 24.1.1

RUN set -ex; \
\
Expand Down
12 changes: 8 additions & 4 deletions integration/linux/test/Dockerfile-centos.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ FROM centos:%%PLACEHOLDER%%
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

RUN (source /etc/os-release; \
[ "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y
9 changes: 9 additions & 0 deletions integration/linux/test/Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ RUN set -ex \
&& chmod +x /bin/gosu

FROM ${DOCKER_ARCH}centos:7 AS glibc
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-*

RUN repoquery -l "glibc" "glibc-common" \
| grep -v --fixed-strings -- '/.build-id' \
| grep -v --fixed-strings -- '/usr/share/doc' \
Expand Down
12 changes: 8 additions & 4 deletions integration/linux/test/centos-7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ fi\n\' >/entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN (source /etc/os-release; \
[ "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y
12 changes: 8 additions & 4 deletions integration/linux/test/centos-8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ fi\n\' >/entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN (source /etc/os-release; \
[ "$VERSION" = "8" ] && (cd /etc/yum.repos.d/ \
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y) || true)
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y
9 changes: 9 additions & 0 deletions integration/linux/test/linux-aarch64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ RUN set -ex \
&& chmod +x /bin/gosu

FROM ${DOCKER_ARCH}centos:7 AS glibc
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-*

RUN repoquery -l "glibc" "glibc-common" \
| grep -v --fixed-strings -- '/.build-id' \
| grep -v --fixed-strings -- '/usr/share/doc' \
Expand Down
9 changes: 9 additions & 0 deletions integration/linux/test/linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ RUN set -ex \
&& chmod +x /bin/gosu

FROM ${DOCKER_ARCH}centos:7 AS glibc
# rpm on centos 7 iterates over all fds up to the limit, which is
# extremely slow. Force it to be small with ulimit.
#
# We need to disable the mirrorlist and explicitly set up a
# baseurl. Switch to the archive.kernel.org mirror while we are at it.
RUN ulimit -n 1024 \
&& sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|# \?baseurl=http://mirror.centos.org|baseurl=https://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-*

RUN repoquery -l "glibc" "glibc-common" \
| grep -v --fixed-strings -- '/.build-id' \
| grep -v --fixed-strings -- '/usr/share/doc' \
Expand Down

0 comments on commit d606c88

Please sign in to comment.