A wordpress image will not restart, a container could. The image is just a template. If the containers is restarting, it means that it stops for some reason which should result some log messages. Can you share the container logs?
You could also update Docker DEsktop as the latest version is now 4.18.0 which could have fixed some bugs if that caused your issue.
I also fixed your post. Please format inserted code properly next time following the below guide.