Docker pull from artifactory fails with credential

2019-08-22 21:09发布

问题:

I have a Jenkins job on a remote environment where I use docker to pull down an image (microsoft/aspnetcore-build/2.0.0) from a local Artifactory repo, but the docker pull fails with - 'unknown: Forbidden', yet other jobs sharing the same Artifactory credentials do not fail.
The docker pull seems to proceed only when attempted from my local or any other machine, and then the job is kicked off manually on Jenkins. There are multiple retries for each image layer and subsequently it fails with -

'unknown: Rejected artifact download request: User xyz is not permitted to deploy 'microsoft/aspnetcore-build/2.0.0'.

回答1:

try add docker login -u $DOCKER_USER -p $DOCKER_PW $DOCKER_URL to make sure you already loggin