Setting up the DockerHub repository
First, create a repository on DockerHub by following these steps:
- Log in to DockerHub, then click on Repositories at the top.
- Under Repositories, click the Create repository button:
- In the Create repository window, set the repository name to sampleapp and change the repository visibility to Private.
- Click the Create button. This will create the repository and redirect you back to the repositories list. Note the Docker push command. It should look like: docker push <YOUR_ACCOUNT_NAME>/sampleapp:tagname
Now you will need to generate the access token to enable the workflow to authenticate to DockerHub. To create the access token:
- Click on your username in the top-right corner of the Docker Hub site.
- From the dropdown menu, select My Account, and then click the Security tab on the left:
- Click the New Access Token button. This opens the New Access Token window, in which:
- Type ci-cd for the token name.
- Select Read, Write, Delete permissions and then click the Generate button.
- A Copy Access Token window appears. Ensure you copy and safely store the generated access token.