Follow the given steps to add credentials inside Jenkins to allow it to talk to Docker:
- From the Jenkins dashboard, navigate to Credentials | System | Global credentials (unrestricted).
- Click on the Add Credentials link on the left-hand side menu to create a new credential (see the following screenshot).
- Choose Kind as Username with Password.
- Leave the Scope field to its default value.
- Add a username for your Docker image (jenkins, as per our example) under the Username field.
- Under the Password field, add the password.
- Add an ID under the ID field, and a description under the Description field.
- Once done, click on the OK button:
Creating credentials inside Jenkins