Pusing Docker images to AWS ECR

The docs says that when creating a docker image you can push it to AWS ( Amazon Elastic Container Registry) instead of Docker Hub.

Does anyone know how to do this, and how to reference the docker image in the docker-compose.override.yml file?

See the following solution I posted in this thread: