【发布时间】:2020-04-30 15:48:24
【问题描述】:
我正在构建一个 python docker 映像,我需要在我的应用程序中使用 firebase CLI(通过 os.system 命令访问)。我正在尝试通过在 dockerfile 中运行它来安装它:
FROM python:3.6.8
RUN curl -sL https://firebase.tools | bash
从docker build -t my_image/firebase获取此输出:
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM python:3.6.8
---> 48c06762acf0
Step 2/2 : RUN curl -sL https://firebase.tools | bash
---> Running in 11536da1cdb4
-- Checking for existing firebase-tools on PATH...
-- Checking your machine type...
-- Links...
[Binary URL] https://firebase.tools/bin/linux/latest
-- Downloading binary...
bash: line 148: sudo: command not found
-- Setting permissions on binary...
bash: line 154: sudo: command not found
bash: line 163: firebase: command not found
Something went wrong, firebase has not been installed.
Please file a bug with your system information on Github.
https://github.com/firebase/firebase-tools/
-- All done!
The command '/bin/sh -c curl -sL https://firebase.tools | bash' returned a non-zero code: 1
如果有任何关于如何执行此操作的提示,我们将不胜感激。使用RUN npm install -g firebase-tools 不是一个选项,因为我正在构建python 图像。
【问题讨论】:
-
看起来错误来自未找到“sudo”。你试过先安装 sudo 吗?
-
你想要github.com/firebase/firebase-admin-python 代替吗? firebase.google.com/docs/admin/setup 建议这是服务器端应用程序的正确库。调用
os.system()只是为了进行网络调用通常不是好的设计。 -
github.com/firebase/firebase-tools 上的“安装”部分(来自错误消息)也建议了替代路径。
-
我正在使用 firebase CLI 来更新 deploy targets,所以很遗憾 firebase-admin-python(它只“提供 Firebase 自定义身份验证支持”)将不起作用。
标签: python bash docker firebase-cli firebase-tools