jenkins DockerHub - ghdrako/doc_snipets GitHub Wiki

  1. Click on Manage Jenkins in the left-hand menu to install the plugins
  2. Click on Plugin Manager. Four tabs will appear. Click on the Available tab and select
    • Docker,
    • docker-build-step,
    • Cloudbees Docker Build,
    • Publish plugins
  3. Click Install without restart.
  4. After installation, check Restart Jenkins when installation is complete and no jobs are running.
  5. Wait until it is done, and the dashboard is shown. Click on the project's name, that is, hit_count
  6. Click Configure in the left-hand menu to modify the project configurations
  7. Modify the details in the Build tab only. Click on it and select Add build step. A larger menu than the one you saw before will show up. If you see Docker Build and Publish in that menu, it verifies that your plugins were installed successfully. Click Docker Build and Publish
  8. In Registry Credentials, click Add. Then select Jenkins from the drop-down menu
  9. A pop-up box will appear. Enter your Docker Hub username and password. Then, click Add:
  10. Now, in Registry Credentials, click the first drop-down menu and select the credentials that you entered in the previous step. Then, enter / in the Repository Name field.
  11. Remove the Execute Shell option Uploading the Code to GitHub, by clicking the Red X at the top right.
  12. Click Save to save the new configuration (you will have only one build step, which is the Docker Build and Publish)
  13. Click Build Now again in the left-hand menu and in the Build History option, follow the progress of the image build. It will have the same name that you specified in Repository Name in the previous step. Jenkins will add the docker build step by itself because you chose it from the plugins. If the image passed the build successfully, Jenkins will use your Docker credentials and automatically connect to Docker Hub or any registry you specify in Repository Name. Finally, Jenkins will push the new image automatically to your registry, which is your Docker Hub registry in this exercise.
⚠️ **GitHub.com Fallback** ⚠️