简体   繁体   中英

how to build docker image using jenkins x

I am trying to build docker Image using jenkins x and I have created kubernetes cluster using minikube. got an error /var/jenkins_home/workspace/sarika-ps_go-k8s_master@tmp/durable-6564436e/script.sh: docker: not found . I have installed the docker plugin on jenkins x. Please help me. Thanks

what kind of project are you trying to build? If you try to import your code you'll hopefully find your project gets setup correctly.

basically Jenkins X uses build pods to run the pipelines which already have all the software tools required for pipelines (docker, skaffold, kubectl etc) inside the build pod which is defined as a docker image.

Try to reuse one of the existing build pods - eg using jenkins-maven as the build agent:

 pipeline {
  agent {
    label "jenkins-maven"
  }
  stages {
    stage('release') {
      steps {
        container('maven') {
          sh "docker build -t foo:bar ."
...

or you could try create a custom build pod .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM