Supabase CLIでDocker Imageが見つからないときの対処法

2025/02/08に公開

動作環境

  • macOS:Sonoma 14.7.1
  • Homebrew v4.4.20-101-g1f5a84a
  • Node.js v20.10.0
  • pnpm v9.15.4
  • supabase-cli v2.9.6

やろうとしていたこと

  • supabase cli経由でローカルにSupabase環境を構築しようとした

エラーの内容

  • supabase startコマンドを打つと、以下のエラーが発生した
% supabase start
failed to pull docker image: Error response from daemon: manifest for public.ecr.aws/supabase/postgres:15.8.1.034 not found: manifest unknown: Requested image not found
Retrying after 4s: public.ecr.aws/supabase/postgres:15.8.1.034
failed to pull docker image: Error response from daemon: manifest for public.ecr.aws/supabase/postgres:15.8.1.034 not found: manifest unknown: Requested image not found
Retrying after 8s: public.ecr.aws/supabase/postgres:15.8.1.034
Stopping containers...
failed to pull docker image: Error response from daemon: manifest for public.ecr.aws/supabase/postgres:15.8.1.034 not found: manifest unknown: Requested image not found
Try rerunning the command with --debug to troubleshoot the error.

エラー内容の解読

  • エラーにはpublic.ecr.aws/supabase/postgres:15.8.1.034というDocker Imageが存在しないとの記述がある
  • Amazon ECR Public Galleryのsupabase/postgresを確認すると、確かに~034だけ存在しなかった(前は問題なく使えてたので途中で消されたのかな?)

類似事例の検索

  • 調べてみると、自分の全く同じエラーで詰まっているという旨のIssuesが17時間前に挙げられていた

  • 解決策は書かれてなかったため色々検証することにした

https://github.com/supabase/supabase/issues/33421

試したこと

  • Supabase CLI内部でどのDocker Imageをプルするかを設定できる方法が見つからなかったため、とりあえずSupabase CLIのバージョンを上げたりしてみたが効果はなかった。
  1. Homebrew経由でインストールしていたので再インストールしてみた
brew uninstall supabase
brew install supabase/tap/supabase
supabase start
  1. pnpm経由でインストールしたものを使ってみた
pnpm add supabase@latest --save-dev
pnpm supabase start
  1. pnpmで前のstableっぽいバージョン(2.6.8)を指定して使ってみた
pnpm add supabase@2.6.8 --save-dev
pnpm supabase start
![](https://storage.googleapis.com/zenn-user-upload/b0efe3cead3d-20250208.png)

https://www.npmjs.com/package/supabase/v/2.6.8?activeTab=versions

解決策

  • 色々調べてたら以下のIssueを見つけた

(原文) I was about to get around this by changing my postgres version in supabase/.temp/postgres-version from 14.1.0.76 to 15.1.0.117.
(日本語訳) supabase/.temp/postgres-version にある postgres のバージョンを 14.1.0.76 から 15.1.0.117 に変更することで、これを回避しようとしていました。

  • たしかにsupabaseディレクトリ直下の.tempディレクトリにpostgres-versionが存在した
  • postgres-versionファイル内のバージョンを、先程存在を確認した15.8.1.037に変更してみる
  • Supabaseのコントリビューターの方から、新しいバージョンではなく古いバージョンを使用した方が良いとの回答があったため、15.8.1.032に変更する(2025/02/10 追記)
postgres-version
- 15.8.1.034
+ 15.8.1.032
  • もう一度ローカル環境構築を試みてみると、無事起動した
% supabase start

WARNING: You are running different service versions locally than your linked project:
supabase/postgres:15.8.1.037 => 15.8.1.034
Run supabase link to update them.
15.8.1.037: Pulling from supabase/postgres
1b9f3c55f9d4: Already exists 
94689feb2a6e: Pulling fs layer 
45d289b93e3d: Pulling fs layer 
...

(原文) WARNING: You are running different service versions locally than your linked project:
supabase/postgres:15.8.1.032 => 15.8.1.034
Run supabase link to update them.
(日本語訳) 警告: リンクされたプロジェクトとは異なるサービスバージョンでローカル実行しています:
supabase/postgres:15.8.1.032 => 15.8.1.034
バージョンを更新するには、supabase link を実行してください。

  • 最後にローカルとリモートのバージョン差異を修正して終了
  • Warning通りにリモートとリンクすると、リモート側のpostgres-versionで上書きされてしまう。
  • 恐らくこの記事を読んでいる人はリモート側のpostgres-versionが~034となっており困っているはずなので、以下のコマンドでリンクした後は、毎回必ずpostgres-versionの値を変更すること。
supabase link

終わりに

  • 今回のようなエラーはあまり類似のIssueとかがあがってなかったので、消されるバージョンのDocker Imageを使うような設定にたまたまなっている人しか踏まないものではないかと思われる

  • しかし今後も使っていたイメージが削除されるという現象が発生する可能性は十分にあるため、備忘録として書いておく

  • 元のIssueにコメントしてたらSupabaseのコントリビューターの方からコメントがあった
    (2025/02/10 追記)

削除されたのではなく、GitHub のアクションパイプラインにバグがあったため、公開されなかっただけです。 Supabaseチームはこの問題を解決するために取り組んでいます(昨日、解決しようとしましたが、イメージはDocker Hubに公開されただけで、ECRには公開されませんでした)が、修正されるのは月曜日の夕方頃になりそうです。 あなたが使っている回避策は今のところ問題ありませんが、新しいバージョンのイメージではなく、古いバージョンを使うことをお勧めします。

  • とのことなので、本記事の回避策で耐えながら待ちの姿勢で一旦良さそう
  • Github Issueは偉大ッッ!!

追記

  • しかしsupabase db pushsupabase db linkを行うと、クラウド側で使用されているバージョンでpostgres-version内の値が上書きされるため、依然として根本的な解決には至っていないと思われる
  • クラウド側で使用されるsupabase/postgresのDocker Imageのバージョンを指定・変更する方法が不明なため、根本的な解決はIssueの対応待ち

参考

https://github.com/supabase/supabase/issues/33421
https://github.com/supabase/supabase/issues/19392
https://www.npmjs.com/package/supabase/v/2.6.8?activeTab=versions
https://gallery.ecr.aws/supabase/postgres

Discussion