Sabbagh's Blagh
The Software blog of a Development Journeyman

Cache Docker Images You Use Regularly On Codebuild

September 13, 2023

tagged: AWS, ECR, Codebuild

Geocaching Thanks to Martin Lostak for making this photo available freely on unsplash 🎁


If you're using Codebuild and have integrated docker into your CI pipeline, you have probably run across this error before:


docker unauth'dfail.

This is frustrating because your code is not responsible for this failure.


If you get this error, its probably because you are pulling the images from docker hub without first authenticating to Docker. The obvious fix for this is to create a docker account and login before you pull the images.


But notice that little word 'upgrading' in the error message above. Upgrading means money.


An alternative that a teammate proposed was pretty simple - cache the images you use in your builds inside of a container registry!

That way, you can pull it as many times as you want without hitting the unauthenticated docker threshold.

© Copyright 2024 Sabbagh's Blagh. Powered with by CreativeDesignsGuru