Jenkins can't access repository in local registry

I created a Dockerfile to build a Jenkins slave image. Basically it uses the Ubuntu OS along with the ssh server listening on port 22. Then I have Jenkins points to this image for a slave agent for build. I tested all the connectivity to the Docker host, and all is good. But when I run the Jenkins job, I got the below error. What’s the cause of this problem?

Unexpected exception encountered while provisioning agent Image of jenkinsslave
com.github.dockerjava.api.exception.NotFoundException: {“message”:“repository jenkinsslave not found: does not exist or no pull access”}

In fact, if I try to do a Docker pull for a Jenkins slave from the public Docker hub, and have Jenkins reference this image, everything works fine. When I do a Docker run on the image inside the Docker host, everything works fine.