Docker build failing for pulling centos image on Mac

I am trying to build a docker image for centos and this is my dockerfile

FROM myregistry/centos:7
ADD http://server:port/build/repo/CentOS-Base.repo /etc/yum.repos.d/.
ADD http://server:port/build/repo/yum.conf /etc/.

# INSTALL TOOLS
RUN yum -y upgrade \
 && yum -y install openssh-server \
    openssh-clients \
    openssl \
    less \
    which \
    wget \
    nano \
    sudo \
    net-tools \
    java-1.8.0-openjdk-headless \
    make \
    ant \
    python3 \
    python3-pip \
    traceroute \
    nc \
    git \
 && yum -y clean all \
 && rm -rf /tmp/* /var/tmp/*

This is my error

**#10 138.0 warning: /var/cache/yum/aarch64/7/updates/packages/bind-license-9.11.4-26.P2.el7_9.10.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
#10 138.0 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#10 138.0 Importing GPG key 0xF4A80EB5:
#10 138.0  Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
#10 138.0  Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
#10 138.0  Package    : centos-release-7-9.2009.0.el7.centos.aarch64 (@instCentOS)
#10 138.0  From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#10 138.0 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#10 138.0 
#10 138.0 
#10 138.0 The GPG keys listed for the "CentOS-7 - Updates" repository are already installed but they are not correct for this package.
#10 138.0 Check that the correct key URLs are configured for this repository.
#10 138.0 
#10 138.0 
#10 138.0  Failing package is: systemd-libs-219-78.el7_9.7.aarch64
#10 138.0  GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7**

I am trying to find out how to get rid of this error
So far I have added an extra line yum install deltarpm in my dockerfile, but I am still getting the same error.
I think the 2 ADD lines in the file are the problem, somehow the wrong repo is getting added. I am trying to find the correct one here.

Read more here: Source link