Docker compose zsh autocomplete for new style no dash command

I have a working ZSH autocomplete for “old style” docker-compose:

docker-compose run [tab]`

However this does not seem to work when compose is now part of the main docker command:

docker compose run [tab]

Is there a way to make ZSH autocomplete to work with new style docker compose?

Maybe

https://github.com/docker/compose/issues/8550#issuecomment-2052631352

For some reason, the instruction in the Docker documentation didn’t work for me either on macOS, but the way mentioned in the post did

Add this to ~/.zshrc

source <(docker completion zsh)

If you do that, the docker command will run every time you open a zsh shell

Original guide