Installling gcloud CLI tool.
For mac with brew
brew cask install google-cloud-sdk
For the rest of cases
Go to this page https://cloud.google.com/sdk/install and follow instructions.
Installing the beta components
gcloud components install beta
Logging into your google cloud account
gcloud auth login
Configuring Docker with GCR
gcloud auth configure-docker