简体   繁体   English

如何使用詹金斯x构建docker映像

[英]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. 我正在尝试使用jenkins x构建docker镜像,并且已经使用minikube创建了kubernetes集群。 got an error /var/jenkins_home/workspace/sarika-ps_go-k8s_master@tmp/durable-6564436e/script.sh: docker: not found . 收到错误/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. 我已经在jenkins x上安装了docker插件。 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. 基本上,Jenkins X使用build pod运行管道,这些管道已经具有定义为docker映像的build pod内部的管道所需的所有软件工具(docker,skaffold,kubectl等)。

Try to reuse one of the existing build pods - eg using jenkins-maven as the build agent: 尝试重用现有的构建jenkins-maven之一-例如,使用jenkins-maven作为构建代理:

 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 . 或者,您可以尝试创建自定义构建容器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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