---
title: "Comment by Ashish Mondal on \"Jenkins Pipeline for Java based application using Maven, SonarQube, Argo CD and Kubernetes\" | Hashnode"
description: "hii this is amazing but i ran into an error in build stage can anyone help Started by user Ashish Mondal Obtained java-maven-sonar-argocd-helm-k8s/spring-boot-a"
url: "https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab"
---

[Discussion](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c)

Comment [Jenkins Pipeline for Java based application using Maven, SonarQube, Argo CD and Kubernetes](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c)

[Ashish Mondal](https://hashnode.com/@Hawk95)

[May 29, 2023](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab)

hii this is amazing but i ran into an error in build stage can anyone help Started by user Ashish Mondal Obtained java-maven-sonar-argocd-helm-k8s/spring-boot-app/JenkinsFile from git [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) \[Pipeline\] Start of Pipeline \[Pipeline\] node Running on Jenkins in /var/lib/jenkins/workspace/ultimate-demo \[Pipeline\] { \[Pipeline\] stage \[Pipeline\] { (Declarative: Checkout SCM) \[Pipeline\] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE No credentials specified

> git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/ultimate-demo/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) # timeout=10 Fetching upstream changes from [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) git --version # timeout=10 git --version # 'git version 2.34.1' git fetch --tags --force --progress -- [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) +refs/heads/_:refs/remotes/origin/_ # timeout=10 git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision acaf393f80b94a5b905e891661d5da7e7af51868 (refs/remotes/origin/main) git config core.sparsecheckout # timeout=10 git checkout -f acaf393f80b94a5b905e891661d5da7e7af51868 # timeout=10 Commit message: "Update JenkinsFile" git rev-list --no-walk b96312af3baf66c1301f51c409f6cb589166b549 # timeout=10 \[Pipeline\] } \[Pipeline\] // stage \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh
> 
> -   docker inspect -f . ashishm95/maven-abhishek-docker-agent:v1

Error: No such object: ashishm95/maven-abhishek-docker-agent:v1 \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh

-   docker pull ashishm95/maven-abhishek-docker-agent:v1 Error response from daemon: pull access denied for ashishm95/maven-abhishek-docker-agent, repository does not exist or may require 'docker login': denied: requested access to the resource is denied \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // node \[Pipeline\] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE

[Sunita](https://hashnode.com/@sunitabachhav2007)

[May 29, 2023](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab#reply-64747acd78c17ca412805bd1)

I used agent created by Abhishek Veeramalla. He explained this agent image is with docker and maven. I haven't tried to create my own agent image. When we run application manually in first step, we first installed maven and docker then created image. docker pull ashishm95/maven-abhishek-docker-agent:v1 Did you created your own agent with maven and docker? if not then use 'abhishekf5/maven-abhishek-docker-agent:v1' as it is. Thanks.

[Ashish Mondal](https://hashnode.com/@Hawk95)

[May 29, 2023](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab#reply-64747bd022df5ead69e5e714)

[Sunita](https://hashnode.com/@sunitabachhav2007) Actually i have redo that agent thing i kept it as it is the below is my jenkinsfile but the error is still the same its not getting the git

pipeline { agent { docker { image 'abhishekf5/maven-abhishek-docker-agent:v1' args '--user root -v /var/run/docker.sock:/var/run/docker.sock' // mount Docker socket to access the host's Docker daemon } } stages { stage('Checkout') { steps { sh 'echo passed' //git branch: 'main', url: '[github.com/sunitabachhav2007/Jenkins-Zero-To-Hero…](https://github.com/sunitabachhav2007/Jenkins-Zero-To-Hero.git') } } stage('Build and Test') { steps { sh 'ls -ltr' // build the project and create a JAR file sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && mvn clean package' } } stage('Static Code Analysis') { environment { SONAR\_URL = "http://35.172.186.121:9000" } steps { withCredentials(\[string(credentialsId: 'sonarqube', variable: 'SONAR\_AUTH\_TOKEN')\]) { sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && mvn sonar:sonar -Dsonar.login=$SONAR\_AUTH\_TOKEN -Dsonar.host.url=${SONAR\_URL}' } } } stage('Build and Push Docker Image') { environment { DOCKER\_IMAGE = "ashishm95/ultimate-cicd:${BUILD\_NUMBER}" // DOCKERFILE\_LOCATION = "java-maven-sonar-argocd-helm-k8s/spring-boot-app/Dockerfile" REGISTRY\_CREDENTIALS = credentials('docker-cred') } steps { script { sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && docker build -t ${DOCKER\_IMAGE} .' def dockerImage = docker.image("${DOCKER\_IMAGE}") docker.withRegistry('[index.docker.io/v1/&](https://index.docker.io/v1/',) "docker-cred") { dockerImage.push() } } } } stage('Update Deployment File') { environment { GIT\_REPO\_NAME = "Jenkins-integration" GIT\_USER\_NAME = "Hawk-95" } steps { withCredentials(\[string(credentialsId: 'github', variable: 'GITHUB\_TOKEN')\]) { sh ''' git config user.email "mondalashish74@gmail.com" git config user.name "Hawk-95" BUILD\_NUMBER=${BUILD\_NUMBER} sed -i -e "s/ultimate-cicd.\*/ultimate-cicd:${BUILD\_NUMBER}/g" java-maven-sonar-argocd-helm-k8s/spring-boot-app-manifests/deployment.yml git add java-maven-sonar-argocd-helm-k8s/spring-boot-app-manifests/deployment.yml git commit -m "Update deployment image to version ${BUILD\_NUMBER}" git push [github.com/$%7BGIT\_USER\_NAME%7D/$%7BGIT\_REPO\_NAME…](https://$%7BGITHUB_TOKEN%7D@github.com/$%7BGIT_USER_NAME%7D/$%7BGIT_REPO_NAME%7D) HEAD:main ''' } } } } }

error

Started by user Ashish Mondal Obtained java-maven-sonar-argocd-helm-k8s/spring-boot-app/JenkinsFile from git [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) \[Pipeline\] Start of Pipeline \[Pipeline\] node Running on Jenkins in /var/lib/jenkins/workspace/jenkins-git-intigration \[Pipeline\] { \[Pipeline\] stage \[Pipeline\] { (Declarative: Checkout SCM) \[Pipeline\] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE No credentials specified

> git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/jenkins-git-intigration/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) # timeout=10 Fetching upstream changes from [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) git --version # timeout=10 git --version # 'git version 2.34.1' git fetch --tags --force --progress -- [github.com/Hawk-95/Jenkins-integration.git](https://github.com/Hawk-95/Jenkins-integration.git) +refs/heads/_:refs/remotes/origin/_ # timeout=10 git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision a3526aec3aa9886f89e5d46286ba2af7f2b49080 (refs/remotes/origin/main) git config core.sparsecheckout # timeout=10 git checkout -f a3526aec3aa9886f89e5d46286ba2af7f2b49080 # timeout=10 Commit message: "Update deployment.yml" git rev-list --no-walk a3526aec3aa9886f89e5d46286ba2af7f2b49080 # timeout=10 \[Pipeline\] } \[Pipeline\] // stage \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh
> 
> -   docker inspect -f . abhishekf5/maven-abhishek-docker-agent:v1

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/container… dial unix /var/run/docker.sock: connect: permission denied \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh

-   docker pull abhishekf5/maven-abhishek-docker-agent:v1 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/cr… dial unix /var/run/docker.sock: connect: permission denied \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // node \[Pipeline\] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE
