I have a GitHub Enterprise repository which contains an ASP.NET Core WebAPI sample project with just ValueController.

I also have access to Jenkins instance most probably running on Docker somewhere on the cloud where I have created a freestyle project and I have established the connection between Jenkins and GitHub using GitHub Hooks.

When ever there's a commit to GitHub repo then a build (Pull the latest from Git,) is triggered in Jenkins and it finishes successfully.

Now I want to perform the next step i.e. Restore Nuget and then build the application. I have a docker file in the project directory but I don't know how to make Jenkins execute that.

I tried putting docker build -t ASP.NETCoreSampleWebAPI . in the Build -> Execute shell -> Command but during executin I get the error error

git rev-list --no-walk 26f9309f6828edf5c3df98c761b5742ae646d1bc # timeout=10 [ASP.NETCoreSampleWebAPI] $ /bin/sh -xe /tmp/jenkins4914681187652875216.sh + docker build -t ASP.NETCoreSampleWebAPI . /tmp/jenkins4914681187652875216.sh: 2: /tmp/jenkins4914681187652875216.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE

Can some one guide me on how to use the dockerfile or docker-compose inside the project directory with Jenkins and do I need to install Docker on the Jenkins server.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.