How to build docker image using Jenkins pipeline?

末鹿安然 提交于 2019-12-06 10:22:17

You're not instructing Jenkins to check out your repository. You do this by adding checkout scm before calling docker. Like this:

node {
  checkout scm
  sh "docker build -t 192.168.59.224:5000/ubuntu-test ."
}

The variable scm is set by Jenkins when you use "Pipeline from SCM" and points to the location where Jenkins got the Jenkinsfile from.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!