1

I've been using the jib-maven-plugin to build docker tarball images from a bamboo container instance which is then pushed to an ECR.

I have the following server instance in ~/.m2/settings.xml which resides in the builder image:

<server>
  <id>registry.hub.docker.com</id>
  <username>${docker.hub.username}</username>
  <password>${docker.hub.password}</password>
</server>

This I then call with maven:

mvn -Ddocker.hub.username=${bamboo.docker_hub_username} \
    -Ddocker.hub.password=${bamboo.docker_hub_password} \
    package deploy

where deploy is associated with the buildTar jib execution goal.

This however does not seem to use my account when pulling images from dockerhub which I need for amazoncoretto.

I recieve the following error from jib.

Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.6.0:buildTar (docker-package) on project auth-server: 429 Too Many Requests
{
  "errors": [
    {
      "code": "TOOMANYREQUESTS",
      "message": "You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"
    }
  ]
}
Brett Ryan
  • 26,937
  • 30
  • 128
  • 163

2 Answers2

1

I have found a workaround by utilising the jib jib.from.auth.username and jib.from.auth.password system parameters.

mvn -Djib.from.auth.username=${bamboo.docker_hub_username} \
    -Djib.from.auth.password=${bamboo.docker_hub_password} \
    package deploy
Brett Ryan
  • 26,937
  • 30
  • 128
  • 163
0

There are a lot of aliases for docker hub. For images that we determine are to/from docker because they do not contain a registry hostname, jib uses the hostname: registry-1.docker.io

Code: https://github.com/GoogleContainerTools/jib/blob/master/jib-core/src/main/java/com/google/cloud/tools/jib/api/ImageReference.java#L38

Maybe using that in your maven settings could help?

loosebazooka
  • 2,363
  • 1
  • 21
  • 32