5
1

More than 5 years have passed since last update.

Dockerコンテナ上でfirebase loginする方法

Posted at

Dockerコンテナ上でfirebase loginしたときに迷ったところをメモ。

コンテナを起動して表示されたURLからGoogleログインしてアクセス許可すると、
http://localhost:9005/?state=... 」にリダイレクトされる。
ローカルでfirebaseが動いているわけじゃないからアクセスできない。

# コンテナを起動して
docker container run -it firebase bash

# firebase loginしてみる
firebase login
? Allow Firebase to collect anonymous CLI usage and error reporting information? No

Visit this URL on any device to log in:
https://accounts.google.com/o/oauth2/auth?...

Waiting for authentication...

# 上記URLからGoogleログインしてアクセス許可するとlocalhost:9005にリダイレクトされる。。

こういう場合はコンテナ側のポート9005を公開してあげれば大丈夫。

docker container run -it -p 9005:9005 firebase bash
5
1
1

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
5
1