'How to pull a Docker Image in Jenkins

I have a Docker Image called "build-ccsmp-ol8-x86", and I want to pull this image into my Jenkins Job. I tried this-

node ('dev2-165') {
  docker.image('node:build-ccsmp-ol8-x86').inside {
    sh 'node --version'
  }
}

But I am getting Error saying-

+ docker inspect -f . build-ccsmp-ol8-x86
 
Error: No such object: build-ccsmp-ol8-x86

Is there any way to do this correctly? Any suggestions are highly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source