I've created jenkins job with Jenkinsfile configuration which should be executed in docker container. There is a problem with pulling docker image from docker hub: node:16-stretch I've received error like: Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
Below I show part of my Jenkinsfile responsible for pulling docker image in declarative approach:
stages {
stage('Docker container initialize') {
agent {
docker {
image 'node:16-stretch'
reuseNode true
}
}
steps {
sh 'node --version'
sh 'yarn --version'
}
}
I have requirement to run job with node version >=14.18.0 and yarn >=1.22.0. Image node:16-stretch meet this requirements. How should I configure correctly my jenkinsfile in order to pull this above image? Should I add some credentials in job configuration or maybe in Jenkinsfile script? I would be grateful for help :)
