Skip to content

fix: pass Docker Hub credentials for images without a registry prefix#935

Merged
DDtKey merged 2 commits intotestcontainers:mainfrom
zfarrell:fix/docker-hub-credentials
Apr 13, 2026
Merged

fix: pass Docker Hub credentials for images without a registry prefix#935
DDtKey merged 2 commits intotestcontainers:mainfrom
zfarrell:fix/docker-hub-credentials

Conversation

@zfarrell
Copy link
Copy Markdown
Contributor

We kept hitting Docker Hub rate limits (429 Too Many Requests: You have reached your unauthenticated pull rate limit) when running tests, despite being logged in via docker login. Traced it to credentials_for_image — it calls descriptor.split_once('/') to extract the registry, which returns None for standard Docker Hub images like postgres:16 (no slash). So credentials are never looked up and pulls go unauthenticated.

This adds a resolve_registry() helper that defaults to index.docker.io when the image has no explicit registry prefix, matching how the Docker CLI resolves it.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 11, 2026

Deploy Preview for testcontainers-rust ready!

Name Link
🔨 Latest commit ab953eb
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-rust/deploys/69dbd1cf2c41ea0008db8281
😎 Deploy Preview https://deploy-preview-935--testcontainers-rust.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DDtKey
Copy link
Copy Markdown
Contributor

DDtKey commented Apr 12, 2026

Thank you for the contribution!

@DDtKey DDtKey merged commit 1a29616 into testcontainers:main Apr 13, 2026
19 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 15, 2026
DDtKey pushed a commit that referenced this pull request Apr 15, 2026
## 🤖 New release

* `testcontainers`: 0.27.2 -> 0.27.3 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.27.3] - 2026-04-15

### Details
#### Bug Fixes
- Pass Docker Hub credentials for images without a registry prefix
([#935](#935))

#### Miscellaneous Tasks
- Update docker-compose-types requirement from 0.22 to 0.23
([#931](#931))
- Update ferroid requirement from 0.8.7 to 2.0.0
([#929](#929))
- Update russh requirement from 0.56.0 to 0.60.0
([#933](#933))
- Update signal-hook requirement from 0.3 to 0.4
([#934](#934))
- Update temp-dir requirement from 0.1 to 0.2
([#921](#921))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@zfarrell zfarrell deleted the fix/docker-hub-credentials branch April 15, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants