
I tried using firebase from my mac mini and it didn’t work, so i decided to use docker, because i need ubuntu to run firebase cli, but the problem is firebase will give you link to authorize, i cant do that with the original ubuntu docker, i need to make my own image, so here is how i did that
1. Prepare the dockerfile
Make a dockerfile
then build the image with the following command
docker build --tag ubuntu-firebase:latest
2. Run the container
Go to your firebase project folder and run the following command to start the docker container we just created
docker run -it -v "$(pwd)":/data1 -p 9005:9005 ubuntu-firebase:latest
3. Using Firebase CLI
As always, you need to login before you can start using firebase cli
firebase login
Dont forget to go to your project folder(data1)
cd data1
Type the following command to activate your firebase project
firebase use --add
4. Enjoy the Firebase CLI
That’s it, now you can do whatever you want with the firebase project, for me i want to use my firebase functions, so first i go to functions folder and install the necessary package
npm install
After that, i go back and test the functions locally
firebase serve --only functions -o 0.0.0.0 --port=9005
I hope that helps you guys, have a nice day!