In the above Jenkins pipeline scripts, we have used https://github.com/scriptcamp/kubernetes-kaniko Github repo so as per the repo prerequisites we will create the below secret in the same namespace Jenkins.
After configuring this, run the Jenkins job which will build the docker images without using root docker access and push images to the Artifactory docker repository and publish to docker images build info to Artifactory.
kubectl create secret docker-registry saas-credentials --docker-username=$REGISTRY_USER --docker-password=$REGISTRY_PASS --docker-server=test-docker.jfrog.io --docker-email=$REGISTRY_EMAIL
After configuring this, run the Jenkins job which will build the docker images without using root docker access and push images to the Artifactory docker repository and publish to docker images build info to Artifactory.