Skip to content

ctlptl doesn't authenticate requests when creating registry #303

@DerekTBrown

Description

@DerekTBrown

When running ctlptl in the context of a CI pipeline, we often see errors from Dockerhub about ratelimiting:

Creating registry "ctlptl-registry"...
pulling image docker.io/library/registry:2: pulling image docker.io/library/registry:2: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

We have docker login in a previous step of our CI pipeline, so are a bit surprised to see ctlptl issuing unauthenticated requests.

I am definitely not an expert on consuming the Docker CLI programmatically, but it seems like authentication would need to be passed through here:

resp, err := c.ImagePull(ctx, image, types.ImagePullOptions{})

I suspect it needs to look something like this:

https://github.com/docker/cli/blob/06de1f8d2c56737ea06a547197a5ae3701aa5397/cli/command/image/push.go#L80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions