Jenkins - Helm - Docker 尝试 运行 测试时未找到
Jenkins - Helm - Docker not found when try to run a test
目前,我正在使用 Helm 和 Terraform 在 GCP 上部署我的 Jenkins。这是我的地形代码:
variable "project_id" { default = "vision40-teste" }
variable "region" { default = "us-central1-a" }
variable "plugins" { default = [
"kubernetes:1.12.0",
"workflow-job:2.23",
"workflow-aggregator:2.5",
"credentials-binding:1.16",
"git:3.9.1",
"blueocean:1.7.1"
]}
provider "google" {
version = "~> 1.0"
region = "${var.region}"
project = "${var.project_id}"
}
resource "helm_release" "jenkins" {
name = "jenkins"
chart = "stable/jenkins"
set {
name = "Master.AdminUser"
value = "someuser"
}
set {
name = "Master.AdminPassword"
value = "somepassword"
}
set {
name = "Master.InstallPlugins"
value = "{${join(",", var.plugins)}}"
}
set {
name = "Agent.AlwaysPullImage"
value = true
}
set {
name = "Agent.Image"
value = "adriagalin/jenkins-jnlp-slave"
}
set {
name = "Agent.ImageTag"
value = "latest"
}
}
但是当我尝试 运行 某些 docker 管道上的命令时,我收到此错误:
[vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA]
Running shell script
- docker pull node:carbon
/home/jenkins/workspace/vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA@tmp/durable-e821ca88/script.sh:
2:
/home/jenkins/workspace/vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA@tmp/durable-e821ca88/script.sh:
docker: not found
script returned exit code 127
我尝试为代理使用其他图像,但它仍然无法正常工作。
我更新了我的 values.yaml 以使用
Master:
AdminUser: user
AdminPassword: user
InstallPlugins:
- kubernetes:1.12.0
- workflow-job:2.23
- workflow-aggregator:2.5
- credentials-binding:1.16
- git:3.9.1
- blueocean:1.7.1
Agent:
Image: adriagalin/jenkins-jnlp-slave
ImageTag: 1.4
AlwaysPullImage: true
volumes:
- type: HostPath
volumeName: docker-sock
hostPath: /var/run/docker.sock
mountPath: /var/run/docker.sock
目前,我正在使用 Helm 和 Terraform 在 GCP 上部署我的 Jenkins。这是我的地形代码:
variable "project_id" { default = "vision40-teste" }
variable "region" { default = "us-central1-a" }
variable "plugins" { default = [
"kubernetes:1.12.0",
"workflow-job:2.23",
"workflow-aggregator:2.5",
"credentials-binding:1.16",
"git:3.9.1",
"blueocean:1.7.1"
]}
provider "google" {
version = "~> 1.0"
region = "${var.region}"
project = "${var.project_id}"
}
resource "helm_release" "jenkins" {
name = "jenkins"
chart = "stable/jenkins"
set {
name = "Master.AdminUser"
value = "someuser"
}
set {
name = "Master.AdminPassword"
value = "somepassword"
}
set {
name = "Master.InstallPlugins"
value = "{${join(",", var.plugins)}}"
}
set {
name = "Agent.AlwaysPullImage"
value = true
}
set {
name = "Agent.Image"
value = "adriagalin/jenkins-jnlp-slave"
}
set {
name = "Agent.ImageTag"
value = "latest"
}
}
但是当我尝试 运行 某些 docker 管道上的命令时,我收到此错误:
[vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA] Running shell script
- docker pull node:carbon
/home/jenkins/workspace/vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA@tmp/durable-e821ca88/script.sh: 2: /home/jenkins/workspace/vision_front_new_master-PTH4UDTQVSAS7VICPCO2UFHIE5M6B37LQYLEJT5BMAT36AYX77KA@tmp/durable-e821ca88/script.sh: docker: not found
script returned exit code 127
我尝试为代理使用其他图像,但它仍然无法正常工作。
我更新了我的 values.yaml 以使用
Master:
AdminUser: user
AdminPassword: user
InstallPlugins:
- kubernetes:1.12.0
- workflow-job:2.23
- workflow-aggregator:2.5
- credentials-binding:1.16
- git:3.9.1
- blueocean:1.7.1
Agent:
Image: adriagalin/jenkins-jnlp-slave
ImageTag: 1.4
AlwaysPullImage: true
volumes:
- type: HostPath
volumeName: docker-sock
hostPath: /var/run/docker.sock
mountPath: /var/run/docker.sock