Answers: <p>On building the docker image, you need to have the <a href="https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd" rel="nofollow noreferrer">docker daemon enabled</a>.
  You can also use the <a href="https://github.com/GoogleContainerTools/jib" rel="nofollow noreferrer">jib</a>, a Google project, which creates images for your Java applications without the Docker daemon</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-01-04T21:34:52.033Z
Answers: 2019-01-04T21:34:52.033Z
Answers: dalmo.santos
Answers: <p><a href="https://github.com/GoogleContainerTools/kaniko" rel="nofollow noreferrer">https://github.com/GoogleContainerTools/kaniko</a> could be used. I have seen it in action, but now implement it myself yet.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-01-12T16:42:27.813Z
Answers: 2019-01-12T16:42:27.813Z
Answers: 030
Body: <p>I am trying to integrate docker build process in Jenkins. I know the things with docker plugin and configure docker agent and template to build it. I want these things to be done with Jenkins pipeline code.<br>
  Basically, I want below process 
  1. Pull the sources code from git and create maven build</p>
  
  <ol start="2">
  <li><p>Push artifactory .war to nexus </p></li>
  <li><p>Pull another git repo having dockerfile and other supporting data</p></li>
  <li><p>take artifactory (war) from nexus and add it to docker images build.</p></li>
  <li><p>Push the newly updated image to docker repo</p></li>
  <li><p>execute deployment on kubernetes.</p></li>
  </ol>
  
  <p>I have steps to build maven code push it to nexus and deployemnt on k8s. But I am facing issue to build docker image using.  I have jenkin setup using docker image. So need to use docker agent and related plugin in jenkin code. </p>
  
Tags: <jenkins><build-pipeline>
Title: jenkins pipeline code to build docker images
UserDisplayName: Sunil Bhoi
ThreadText: # jenkins pipeline code to build docker images
  
  (Asked by: username_0 on 2019-01-03)
  
  I am trying to integrate docker build process in Jenkins. I know the things with docker plugin and configure docker agent and template to build it. I want these things to be done with Jenkins pipeline code.  
  Basically, I want below process
  1. Pull the sources code from git and create maven build
  
  2. Push artifactory .war to nexus
  3. Pull another git repo having dockerfile and other supporting data
  4. take artifactory (war) from nexus and add it to docker images build.
  5. Push the newly updated image to docker repo
  6. execute deployment on kubernetes.
  
  I have steps to build maven code push it to nexus and deployemnt on k8s. But I am facing issue to build docker image using. I have jenkin setup using docker image. So need to use docker agent and related plugin in jenkin code.
  
  **Tags:** jenkins, build-pipeline
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-01-04. Score: 1
  
  On building the docker image, you need to have the [docker daemon enabled](https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd).
  You can also use the [jib](https://github.com/GoogleContainerTools/jib), a Google project, which creates images for your Java applications without the Docker daemon
  
  
  ---
  
  ### Answer by username_2 on 2019-01-12. Score: 0
  
  <https://github.com/GoogleContainerTools/kaniko> could be used. I have seen it in action, but now implement it myself yet.
  
  
  ---
  
  