ssh-run pipeline toomanyrequests, docker login question
Asked by Andrew S Lane:

Hi,

We've recently run into an issue using <https://bitbucket.org/atlassian/ssh-run/src/master/>. The message we receive is  
Unable to find image 'bitbucketpipelines/ssh-run:0.4.1' locally  
docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit.

I feel we don't perform all that many pulls, so that is one issue that concerns me. In any case we're willing to use a docker account to perform tasks, but I'm confused as to how to do so in the bitbucket-pipelines.yml file as the docker container run command which references the image bitbucketpipelines/ssh-run:0.4.1 doesn't seem configurable in that manner from looking at the README. I've attempted to try some workarounds using Bitbucket Workspace Variables or even environment variables on the host, but those only seem to apply to the COMMAND section of the pipeline and as far as I can tell this is related to the pipeline set up. Here is a screenshot of the output of the failed pipeline, specifically the 'pipe: atlassian/ssh-run:0.4.1' step.

Any assistance is greatly appreciated.

Thank you,

Andrew Lane

![Screen Shot 2023-02-02 at 3.42.26 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/238003i8C10F67F6486C52C/image-size/large?v=v2&px=999 "Screen Shot 2023-02-02 at 3.42.26 PM.png")


Answers:
author: Ben
body: Hey Andrew,

So that I may assist you further - can you confirm if this is standard pipelines or if you are using a workspace/repository runner?  
Also, you are using the bitbucketpipelines/ssh-run build image, correct?

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: aslane
body: Hi Ben!

I know I'm responding late, but this came up again.

1. We are using a workspace runner

2. Correct, using that image.

Thank you,

Andrew


author: Ben
body: Hi Andrew,

This error message refers to rate limiting on unauthenticated/free Dockerhub accounts, you can see more details here:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/>

This means unauthenticated users get 100 image pulls per hour, whereas logged in users get 200 image pulls per hour.

You can either ensure that you are logged in to Dockerhub first, or, you can use a private registry to download images to your Runner - you may use the setup explained on the documentation below, under **"Using private build images"**, depending on where they are stored:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/>

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


author: aslane
body: Hi Ben,

I think the root cause of our pulls being exhausted was failed deployments with AWS (automated repeated attempts to launch containers).

In any case it seems doing this:

script:  
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD  
- pipe: atlassian/ssh-run:0.4.1  
in bitbucket-pipelines.yaml may have gotten around the issue.  
Thanks for your help,  
Andrew


author: aslane
body: Fixed with docker login command as first step of script.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

docker

login

ssh

ssh-run