<p>I'm trying to create a BuildConfig to automatically build a docker image and store it to the GitLab docker registry.</p>
<p>buildconfig.yaml</p>
<pre><code>kind: &quot;BuildConfig&quot;
apiVersion: &quot;v1&quot;
metadata:
  name: &quot;tracker-build&quot; 
spec:
  runPolicy: &quot;Serial&quot; 
  triggers: 
    -
      type: &quot;GitLab&quot;
      gitlab:
        secretReference:
           name: &quot;webhooksecret&quot;
  source: 
    git:
      uri: &quot;https://gitlab.com/USERNAME/rayan_tracker_paas.git&quot;
    sourceSecret:
      name: gitsecret
  strategy: 
    dockerStrategy:
      forcePull: true 
  output:
    to:
      kind: &quot;DockerImage&quot;
      name: &quot;registry.gitlab.com/UESRNAME/rayan_tracker_paas:latest&quot;
    pushSecret:
      name: &quot;gitlab-reg&quot;      
  resources:
    limits:
      cpu: 1500m
      ephemeral-storage: 1G
      memory: 600M
    requests:
      cpu: 1500m
      ephemeral-storage: 1G
      memory: 600M
</code></pre>
<p>After I starting it, I get this error:</p>
<blockquote>
<p>Pulling image node:12 ...
error: build error: failed to pull image: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: <a href="https://www.docker.com/increase-rate-limit" rel="nofollow noreferrer">https://www.docker.com/increase-rate-limit</a></p>
<blockquote>
<p>The rate limits of 100 container image requests per six hours for anonymous usage, and 200 container image requests per six hours for free Docker accounts are now in effect. Image requests exceeding these limits will be denied until the six hour window elapses.</p>
</blockquote>
</blockquote>
<p>Since my application needs nodejs, it trying to pull node official image from docker hub and occur this problem. To solve this problem I need to use docker secret somewhere in buildconfig.yaml file which I couldn't find out by searching in google.</p>

SajjadSM
<p>Finally, I find the solution. I added <code>pullSecret</code> property to the <code>strategy.dockerStrategy</code> block.</p>
<pre><code>strategy:
  dockerStrategy:
    forcePull: true 
    pullSecret:
      name:
        docker-hub
</code></pre>
