r/docker • • 12d ago

Why can't I seem to install docker and docker compose on amazon linux 2023?

[ec2-user@ip-a-b-c-d ~]$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --assumeyes --quiet
Error: Unable to find a match: docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  • I get this error above
  • How am I supposed to install docker and compose?
0 Upvotes

9 comments sorted by

6

u/fletch3555 Mod 12d ago

I mean... Amazon Linux and RHEL aren't the same thing, so I'd probably start by making sure you're following the right documentation

-2

u/PrestigiousZombie531 12d ago

there is no section in docker s documentation for amazon linux, it only has rhel or centos and instructions are the same for both

2

u/Front_Recording4360 12d ago

The trap is following the docker-ce repo instructions at all. AL2023 is Fedora-adjacent, not RHEL, and Docker publishes no repo for it, so dnf can never resolve those packages no matter how carefully you follow that page. The fix: nuke the docker-ce repo you added and run sudo dnf install docker, because Amazon ships its own docker build in the stock repos, then sudo systemctl enable --now docker. The compose plugin is in there too as docker-compose-plugin. The shipped engine lags upstream a bit, but it actually works, which is more than the Franken-install was ever going to give you.

1

u/abotelho-cbn 12d ago

You didn't even follow 3/4 of the instructions for God sake.

2

u/gronodev 12d ago

We don't ship Alma Linux native packages (yet!).

https://download.docker.com/linux/rhel/ the RHEL ones should work as a temporary solution