I have a jenkins instance running on a EKS cluster and I'm trying to setup Jenkins to build my images and push to my ECR but it's not working because docker
seems to be missing.
Here's my Jenkinsfile
pipeline {
agent any
stages {
stage("build"){
steps {
sh('docker -v')
sh('docker login --username AWS --password-stdin dkr.ecr.eu-north-1.amazonaws.com')
sh('docker build -t dkr.ecr.eu-north-1.amazonaws.com/test .')
echo('building app')
}
}
stage('test'){
steps {
sh('docker tag test dkr.ecr.eu-north-1.amazonaws.com/test')
echo('testing app')
}
}
stage('deploy'){
steps {
sh('docker push dkr.ecr.eu-north-1.amazonaws.com/test')
echo('deploying app')
}
}
}
}
But I'm running into an error of script.sh: 1: docker: not found
.
What am I missing, do I need to install Docker on Jenkins, and if so, how do I do that?