In your journey through the world of containerization, oftentimes you will be publishing your images for public consumption or privately sharing images using a Docker registry. To push an image to a public repository, you must log in to a Docker registry and you must be the owner of that repository. In the case of a private repository, both pulling and pushing are allowed, but only once you are logged in. In this recipe, we will see how to log in and log out of a Docker registry.
Logging in and out of the Docker image registry
Getting ready
Ensure that you have a valid Docker ID or GitLab account.