1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

"429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit."になったとき

Posted at

問題

Dockerのイメージをpullしようとして次のような429エラーに遭遇したときの話。

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/library/mysql/manifests/sha256:c86dfd69b3d1437e5d192447f0bdc57407d48bd379b97a453e11d72b97962e3b: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

解決法

イメージの取得元をECRからにする。

具体的には、Amazon ECR Public Galleryから同じイメージを探して、そのイメージURIを取得。

image.png

あるいは元のイメージ名の先頭にpublic.ecr.aws/docker/library/をつけるだけでも解決するはず。

なおこの解決方法はAmazon ECRにアップされているオフィシャルのイメージのみ。またそれぞれのイメージはまったく同じものです(下記参照)。

mysql                                 8.0.32    21978c3803ca   8 months ago     544MB
public.ecr.aws/docker/library/mysql   8.0.32    21978c3803ca   8 months ago     544MB

原因

Dockerイメージのpullにおける429エラーは、時間あたりのpullの回数制限に引っかかっていることを示している。1

ローカル上の実行では引っかかることはないだろうが、IPアドレス単位の制限のためAWS環境だと引っかかることが多い。

そのため回数制限と関係ないAmazon ECRのECR Publicから取得することで解決する。

参照

Docker オフィシャルイメージが ECR Public で利用可能になりました #reinvent | DevelopersIO

  1. https://docs.docker.com/docker-hub/download-rate-limit/

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?