Your URL is wrong, the following worked for me:

RUN curl http://mirror.centos.org/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 -o RPM-GPG-KEY-CentOS-7
RUN rpm --import RPM-GPG-KEY-CentOS-7
RUN yum-config-manager --add-repo='http://mirror.centos.org/centos/7/os/x86_64/'

Note that a lot of their packages will conflict with Amazon's pre-installed packages.

One workaround I've found is to not add that repo, and instead use yum install <direct_rpm_link> for all of my installations. I had to manually resolve some dependencies myself by adding more .rpm links, but at least it worked in the end.

Answer from serg06 on Stack Overflow
🌐
GitHub
gist.github.com β€Ί dasgoll β€Ί 42cc52cbac6fc6f5bdec
How to enable Software Collections (SCL) on Amazon/RHEL/CentOS Β· GitHub
March 27, 2019 - It's been a white, could you look into "Amazon Linux extras repository"? From here: Q. How do I install a software package from Amazon Linux extras repository? [https://aws.amazon.com/amazon-linux-2/faqs/] ... scl-utils, and I'm not using amazon linux 2, I'm using amazon linux 1.
🌐
Zabbix
zabbix.com β€Ί forum β€Ί zabbix-troubleshooting-and-problems β€Ί 412045-having-trouble-installing-frontend-on-amazon-linux-2
Having trouble installing frontend on Amazon Linux 2 - ZABBIX Forums
November 1, 2020 - In other words, it's just zabbix-web package for frontend. Other settings should be set by yourself without depending on the package. Also note that Amazon Linux 2 has been updated independently and is not fully compatible with RHEL 7. ... Package rh-php72 comes from an CentOS repository called centos-release-scl.
Discussions

Add centos repository to Amazon Linux instance - Stack Overflow
I'm trying to add the following yum repository to my AWS instance: https://centos.pkgs.org/7/centos-x86_64/ The issue is that there is no repodata/ directory with the required metadata in this sour... More on stackoverflow.com
🌐 stackoverflow.com
amazon web services - need help to install php 7.2 yum packages on aws ec2 - Stack Overflow
I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month. I have tried yum list | grep php7 and only able see php70 and php71 packages. Has anyone installed... More on stackoverflow.com
🌐 stackoverflow.com
Amazon Linux Extras versus EPEL

I've tested installing a few packages from EPEL for Enterprise Linux 7. Make sure you do use the EL7 version, since Amazon Linux 2 is systemd based:

https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

amazon-linux-extras only has a few packages for now, so if that's all you need, great. Depending on the packages you install, you always run the risk of conflicts between EPEL and Amazon repos.

More on reddit.com
🌐 r/aws
1
15
January 15, 2018
How do I figure out what CentOS version my AMazon Linux distribution is based on? - Unix & Linux Stack Exchange
I was told we recently created a new Amazon Linux instance with the latest and greatest (Version 2017.3–01) . I'm trying to find out if it is based on CentOS 7 (because that is the only version that More on unix.stackexchange.com
🌐 unix.stackexchange.com
August 17, 2017
🌐
Getpagespeed
extras.getpagespeed.com β€Ί repository β€Ί unspecified β€Ί centos-release-scl
How to install centos-release-scl (noarch)
noarch GetPageSpeed extras repository for Amazon Linux 2 | Subscribe Β· Software collections from the CentOS SCLo SIG Β· License: GPLv2 http://wiki.centos.org/SpecialInterestGroup/SCLo Β· Copy Β· sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm sudo amazon-linux-extras install epel sudo yum -y install centos-release-scl Β·
🌐
GitHub
gist.github.com β€Ί mhart β€Ί 841afde086604e7b4a86fa140480c84d
Get SCL (and GCC 7) working on Amazon Linux 2017.03 Β· GitHub
curl -O http://mirror.centos.org/centos/7/os/x86_64/Packages/scl-utils-20130529-19.el7.x86_64.rpm curl -O http://mirror.centos.org/centos/7/os/x86_64/Packages/scl-utils-build-20130529-19.el7.x86_64.rpm curl -O http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm curl -O http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm
🌐
Amazon Web Services
aws.amazon.com β€Ί compute β€Ί amazon linux 2 β€Ί faqs
Amazon Linux 2 FAQs
5 days ago - elfutils-libelf, glibc, glibc-utils, ... ruby, scl-utils, sqlite, systemd-libs, systemtap, tcl, tcp_wrappers-libs, xz-libs, and zlib 3) AWS will provide Application Binary Interface (ABI) compatibility for all other packages in core unless providing such compatibility is not possible for reasons beyond AWS’s control. No, Amazon Linux 2 does not ...
Find elsewhere
🌐
Getpagespeed
extras.getpagespeed.com β€Ί amzn β€Ί 2 β€Ί noarch β€Ί repoview β€Ί centos-release-scl-rh.html
How to install centos-release-scl-rh (noarch)
yum Configs and basic docs for Software Collections as delivered via the CentOS SCLo SIG. sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm sudo amazon-linux-extras install epel sudo yum -y install centos-release-scl-rh Β·
🌐
GitHub
github.com β€Ί sclorg β€Ί centos-release-scl
GitHub - sclorg/centos-release-scl: yum Configs and basic docs for Software Collections as delivered via the CentOS SCLo SIG. Β· GitHub
This package provides yum Configs and basic docs for Software Collections as delivered via the CentOS SCLo SIG only (so called sclo namespace at https://wiki.centos.org/SpecialInterestGroup/SCLo).
Starred by 70 users
Forked by 15 users
Languages Β  Shell
🌐
ComputingForGeeks
computingforgeeks.com β€Ί home β€Ί comparison β€Ί centos 8 vs amazon linux 2 – feature comparison
CentOS 8 vs Amazon Linux 2 - Feature Comparison | ComputingForGeeks
June 14, 2020 - This article goes into the details of what lies behind the skins of CentOS 8 and Amazon Linux 2. Take a relaxing sigh, stay tuned, and indulge in the article that checks the two out in the tabular representation below. Amazon Linux 2 as it can be guessed is now generally available in Amazon Web Services AMI for customers to enjoy without extra costs including support for the latest Amazon EC2 instance capabilities and is tuned for enhanced performance.
🌐
AWS
docs.aws.amazon.com β€Ί amazon linux β€Ί user guide β€Ί identifying amazon linux instances and versions β€Ί using the os-release standard
Using the os-release standard - Amazon Linux 2023
April 20, 2026 - ID_LIKE – Shows distribution relationships: Amazon Linux uses fedora (AL2023) or centos rhel fedora (AL2), while Ubuntu shows debian to indicate its Debian heritage
🌐
Amazon Web Services
aws.amazon.com β€Ί become a partner
Become an AWS Partner | AWS Partner Network
5 days ago - The AWS Partner Network (APN) is a global community of partners that leverages programs, expertise, and resources to build, market, and sell customer offerings.
🌐
DEV Community
dev.to β€Ί andreaolivato β€Ί install-php-8-on-aws-amazon-linux-2-2mdl
Install PHP 8 on AWS Amazon Linux 2 - DEV Community
December 22, 2020 - Error: Package: php80-runtime-1.0-3.el7.remi.x86_64 (remi-safe) Requires: scl-utils You could try using --skip-broken to work around the problem ** Found 5 pre-existing rpmdb problem(s), 'yum check' output follows: 4:perl-5.16.3-294.43.amzn1.x86_64 is a duplicate with 4:perl-5.16.3-286.38.amzn1.x86_64 perl-Getopt-Long-2.40-3.6.amzn1.noarch is a duplicate with perl-Getopt-Long-2.40-2.5.amzn1.noarch 1:perl-Pod-Escapes-1.04-294.43.amzn1.noarch is a duplicate with 1:perl-Pod-Escapes-1.04-286.38.amzn1.noarch 4:perl-libs-5.16.3-294.43.amzn1.x86_64 is a duplicate with 4:perl-libs-5.16.3-286.38.amzn1.x86_64 4:perl-macros-5.16.3-294.43.amzn1.x86_64 is a duplicate with 4:perl-macros-5.16.3-286.38.amzn1.x86_64
🌐
Hacker News
news.ycombinator.com β€Ί item
CentOS 8 vs. Amazon Linux 2 | Hacker News
December 11, 2020 - Curiously, Amazon only supports it till June 30, 2023, a year less than RHEL7/CentOS7. It will be interesting to see what they plan to do for Amazon Linux 3, with the latest CentOS news Β· Rocky Linux from the CentOS creator looks promising:
🌐
Mondoo
mondoo.com β€Ί home β€Ί blog β€Ί amazon linux 2023: a comprehensive overview of new features and updates
Amazon Linux 2023: A Comprehensive Overview of New Features and Updates
March 22, 2023 - While Amazon Linux 2 was based on Red Hat Enterprise Linux (RHEL) 7, each major release of Amazon Linux 2023 will use a combination of Fedora Linux and CentOS Stream. Amazon will then replace specific packages from other upstream sources as needed.
🌐
CentOS
wiki.centos.org β€Ί AdditionalResources(2f)Repositories(2f)SCL.html
The Software Collections ( SCL ) Repository
In order to gain access to SCLs for CentOS, you need to install the CentOS Linux Software Collections release file.