ABBANAPURI0445 / URSI

1 stars 5 forks source link

issue- Failure running docker pipeline project #7

Open msdops20 opened 4 years ago

msdops20 commented 4 years ago

Failure creating the docker image from pipeline project. Below are Dockerfile script, Pipeline(DSL) script and the Console Outputs of the Jenkings-Docker pipeline project

Dockerfile: FROM tomcat:8 RUN curl -u admin:admin123 http://5x.1xx.1xxx.1xx:8082/artifactory/GOL/gameoflife.war RUN cp gameoflife.war /usr/local/tomcat/webapps EXPOSE 8080 CMD [ "catalina.sh","run"]


Dsl/pipeline script: node('docker') { stage('clone dockerfile') { git 'https://github.com/msdxxxxx/test.git' } stage('build docker image'){ sh label: '', script: 'docker image build -t gol:1.0 .' } stage('Push to DockerHub'){ sh label: '', script: 'docker login -u msxxxxx -p xxxxxxx' sh label: '', script: '''docker tag gol:1.0 msxxxxx/newgol:1.0 docker push msxxxxx/newgol:1.0''' }

}

Console Output Running in Durability level: MAX_SURVIVABILITY [Pipeline] Start of Pipeline [Pipeline] node Running on docker-slave in /home/ubuntu/workspace/gol-docker [Pipeline] { [Pipeline] stage [Pipeline] { (clone dockerfile) [Pipeline] git No credentials specified Fetching changes from the remote Git repository Checking out Revision 1c98d31985946162fd170d51c1641c989f1ac6f8 (refs/remotes/origin/master) Commit message: "Update Dockerfile"

git rev-parse --is-inside-work-tree # timeout=10 git config remote.origin.url https://github.com/msxxxxx/test.git # timeout=10 Fetching upstream changes from https://github.com/msxxxxxx/test.git git --version # timeout=10 git fetch --tags --progress -- https://github.com/msxxxxx/test.git +refs/heads/:refs/remotes/origin/ # timeout=10 git rev-parse refs/remotes/origin/master^{commit} # timeout=10 git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 git config core.sparsecheckout # timeout=10 git checkout -f 1c98d31985946162fd170d51c1641c989f1ac6f8 # timeout=10 git branch -a -v --no-abbrev # timeout=10 git branch -D master # timeout=10 git checkout -b master 1c98d31985946162fd170d51c1641c989f1ac6f8 # timeout=10 git rev-list --no-walk 1c98d31985946162fd170d51c1641c989f1ac6f8 # timeout=10 [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (build docker image) [Pipeline] sh

  • docker image build -t gol:2.0 . Sending build context to Docker daemon 59.9kB

Step 1/5 : FROM tomcat:8 ---> 34d28186c789 Step 2/5 : RUN curl -u adxxx:adxxxxxx http://5x.1xx.1xx.1xx:8082/artifactory/GOL/gameoflife.war ---> Using cache ---> 4379277bac7c Step 3/5 : RUN cp gameoflife.war /usr/local/tomcat/webapps ---> Running in bc8ffbf7ca0b cp: cannot stat 'gameoflife.war': No such file or directory The command '/bin/sh -c cp gameoflife.war /usr/local/tomcat/webapps' returned a non-zero code: 1 [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE

Rupini93 commented 4 years ago

I think you have to check the path of gol..

ABBANAPURI0445 commented 4 years ago

Hi Meena garu Please check war file url manually whether the download or not