【问题标题】:How to publish azure function in python using docker from my machine to azure?如何使用 docker 从我的机器发布 azure 函数到 azure?
【发布时间】:2019-08-08 07:42:50
【问题描述】:

当我尝试在 python 中将我的 azure 函数发布到 azure 时,我收到以下错误。

pip version 10.0.1, however version 19.2.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
ERROR: cannot install cryptography-2.7 dependency: binary dependencies without wheels are not supported.  Use the --build-native-deps option to automatically build and configure the dependencies using a Docker container. More information at https://aka.ms/func-python-publish

所以,我已经安装了 docker,并尝试使用以下命令推送我的功能

func azure functionapp 发布 timertriggerforstreaming --build-native-deps

我没有做任何事情我只是安装了docker, 当我尝试发布时,在 windows 容器上使用 docker 时出现以下错误(我的机器是 windows 10)。

Error running docker pull mcr.microsoft.com/azure-functions/python:2.0.12493-python3.6-buildenv.
output: 2.0.12493-python3.6-buildenv: Pulling from azure-functions/python
image operating system "Linux" cannot be used on this platform

我再次从 Windows 切换到 Linux 并再次尝试相同的方法,现在需要很长时间,并且我看到以下输出很长一段时间。 see the image 我的做法是对还是错,还是我需要自己 Dockerize azure 函数并发布它

【问题讨论】:

  • 这是什么意思? “我再次从 Windows 切换到 Linux 并再次尝试了同样的方法,现在需要很长时间。”您需要切换到 Docker for Windows 中的 Linux 容器才能完成这项工作。
  • 请更新帖子@silent
  • 这只是意味着最初的 docker pull 仍在运行。根据图像的大小和您的互联网连接,第一次可能需要一段时间。之后应该会快得多
  • 哦,好的,python 只能在 azure 的 Linux 环境下使用吗?

标签: python-3.x docker azure-functions azure-eventhub azure-functions-core-tools


【解决方案1】:
猜你喜欢
  • 2018-10-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-15
相关资源
最近更新 更多