0
votes

Dockerfile:

pipeline {
    agent  any
    stages {
        stage ('Compile') {
            steps {
                withMaven(maven: 'maven_3_6_3') {
                    sh 'mvn clean compile'
                }
            }
        }
        stage ('unit test and Package') {
            steps {
                withMaven(maven: 'maven_3_6_3') {
                    sh 'mvn package'
                }
            }
        }
        stage ('Docker build') {
            steps {
                sh 'docker build -t dockerId/cakemanager .'
            }
        }
    }
}
  • docker build -t dockerId/cakemanager . /Users/Shared/Jenkins/Home/workspace/CDCI-Cake-Manager_master@tmp/durable-e630df16/script.sh:

line 1: docker: command not found

2
if you need docker, you need to add a slave agent that has docker client. You'll need docker-in-docker image for this. This can be a good starting point.vijay

2 Answers

0
votes

You need to manually install docker on your Jenkins master or on agents if you're running builds on them.

Here's the doc to install docker on OS X https://docs.docker.com/docker-for-mac/install/

0
votes

First install docker plugin from Manage Jenkins >> Manage Plugins >> Click on available and search for Docker and install itenter image description here.

and then configure it on Manage Jenkins >> Global tool configuration. enter image description here