I think you need Docker 28? But maybe 26 would be good enough.
It looks like there is no way to upgrade Centos 7, so you’re going to need to move to a new VM, or if this is your own server, you’ll need to install a new OS to upgrade it. Once you’re installing an OS, it’s not much easier or harder to install any different Linux.
If you don’t want to upgrade your OS, then don’t upgrade Discourse.