Check out example codes for "how to docker login". It will help you in understanding the concepts better.

Code Example 1

$ docker login --username=maryatdocker [email protected]
Password:
WARNING: login credentials saved in C:\Users\sven\.docker\config.json
Login Succeeded

Learn ReactJs, React Native from akashmittal.com