How do I install Docker and Docker Compose on Amazon Linux 2023?

0
0
Asked By MellowPine47 On

I'm running Amazon Linux 2023 on an EC2 instance and tried installing Docker with the package names from Docker's RHEL instructions: `docker-ce`, `docker-ce-cli`, `containerd.io`, `docker-buildx-plugin`, and `docker-compose-plugin`. DNF returns "Unable to find a match" for all of them. The instance has outbound network access. What is the correct way to install Docker and Docker Compose on Amazon Linux 2023?

3 Answers

Answered By OrbitingCedar9 On

Those instructions target RHEL, not Amazon Linux, so the package names and repositories don’t necessarily apply. First check what Amazon’s repositories provide with `dnf search docker` or `dnf list available '*docker*'`. On Amazon Linux 2023, the usual installation is `sudo dnf install -y docker`, followed by `sudo systemctl enable --now docker`. If you want to run Docker without `sudo`, add your login user to the Docker group with `sudo usermod -aG docker ec2-user`, then log out and back in. Docker Compose may need to be installed separately if the Compose plugin isn’t available in the Amazon Linux repositories.

Answered By SilverKite_58 On

A network connection alone doesn’t guarantee that DNF can see the packages. Check the enabled repositories and package metadata with `dnf repolist` and `sudo dnf makecache`. If `dnf search docker` shows no Docker packages, the issue is repository configuration rather than Docker itself.

Answered By QuartzMango22 On

The Docker packages won’t appear until the appropriate package repository is configured, which is what the RHEL documentation’s repository section is referring to. However, adding a RHEL repository to Amazon Linux is not generally the right fix. Use Amazon Linux’s own repositories and inspect the available package names with DNF; `docker-ce` may not be provided even though a package named `docker` is.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.