We often see problems reported inside docker because DNS was not configured quite right. Can you double check your dns configuration and can you confirm you can resolve rubygems.org inside the container?
A i said in the original post above, it works sometimes and not others, and does not always fail on the same gem. I have been using the same basic dockerfile config for about 2 years and it just started failing last week.
Additional info. Here's the incantation i'm using:
Here's a small dockerfile which will trigger the error. Note that it doesn't happen every time, and whatever you did may have made it fail less. If feels to me like one or a few of a set of round-robin servers/processes are corrupt, but not all.