I am using docker on Mac and have Jenkins running in docker container.
Client is interacting with docker daemon on host machine.
I have following plugins installed:
- docker-plugin
- workflow-aggregator
I do have docker client / command working in container. I have also checked it using sh and even docker cloud can spin up agents.
But below Jenkinsfile is contantly throwing error.
def image
pipeline {
agent {
label "container"
}
stages {
stage('Build') {
steps {
script {
image = docker.build("username/image:$BUILD")
}
}
}
}
}
But I am constantly facing below error message:
groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding