【问题标题】:The container image doesn`t support specified OS 'Linux' for container group容器映像不支持容器组的指定操作系统“Linux”
【发布时间】:2020-07-01 18:38:08
【问题描述】:

我想使用 fileShare 准备 Microsoft 容器(必需的框架 4.6),但出现错误。你知道出了什么问题吗?以及如何正确?容器映像“microsoft/aspnet”不支持容器组“mmsappcalculation-1”的指定操作系统“Linux”。

rafal@Azure:~$ # Change these four parameters as needed
rafal@Azure:~$ ACI_PERS_RESOURCE_GROUP=mmsAppCalculationGroup
rafal@Azure:~$ ACI_PERS_STORAGE_ACCOUNT_NAME=fileshare8956
rafal@Azure:~$ STORAGE_KEY=2Ee56ua3I4gU7TgcI3IhAICXhgt+UG0xSL/kb9+PKEGl40T/5rHflEy8DMHwbaFqZL0oMfwzcjyAXDsQDg1Q==
rafal@Azure:~$ ACI_PERS_SHARE_NAME=acishare
rafal@Azure:~$
rafal@Azure:~$
rafal@Azure:~$ az container create \
>     --resource-group $ACI_PERS_RESOURCE_GROUP \
>     --image microsoft/aspnet \
>     --name mmsappcalculation-1 \
>     --dns-name-label mmsappcalculation \
>     --ports 80 \
>     --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME \
>     --azure-file-volume-account-key $STORAGE_KEY \
>     --azure-file-volume-share-name $ACI_PERS_SHARE_NAME \
>     --azure-file-volume-mount-path /app/sharedFile/
The container image 'microsoft/aspnet' doesn't support specified OS 'Linux' for container group 'mmsappcalculation-1'. 

在我运行之前

# Change these four parameters as needed
ACI_PERS_RESOURCE_GROUP=mmsAppCalculationGroup
ACI_PERS_STORAGE_ACCOUNT_NAME=fileshare$RANDOM
ACI_PERS_LOCATION=eastus
ACI_PERS_SHARE_NAME=acishare

# Create the storage account with the parameters
az storage account create \
    --resource-group $ACI_PERS_RESOURCE_GROUP \
    --name $ACI_PERS_STORAGE_ACCOUNT_NAME \
    --location $ACI_PERS_LOCATION \
    --sku Standard_LRS

# Create the file share
az storage share create \
  --name $ACI_PERS_SHARE_NAME \
  --account-name $ACI_PERS_STORAGE_ACCOUNT_NAME

更新 我也尝试这样,但还是不行

https://docs.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest

>     --os-type Windows \
az: error: unrecognized arguments:
usage: az [-h] [--verbose] [--debug] [--only-show-errors]
          [--output {json,jsonc,yaml,yamlc,table,tsv,none}] [--query JMESPATH]
          {container} ...
rafal@Azure:~$     --cpu 2 \
>     --memory 3.5 \
>     --azure-file-volume-mount-path /app/sharedFile/
bash: --cpu: command not found
rafal@Azure:~$

【问题讨论】:

    标签: azure azure-devops azure-functions azure-web-app-service


    【解决方案1】:

    如果您想运行 .Net 核心,您可以使用 Linux 或 Windows 容器。 如果要运行 .Net Framework,则需要使用 Windows 容器。

    microsoft/aspnet 使用 .Net Framework,因此您必须使用 Windows 容器来运行它。

    如果您想在 Azure 应用服务中尝试此操作,这里是我们关于如何在 Azure 应用服务中运行自定义 Windows 容器的快速入门: https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-windows-container

    【讨论】:

    • 好的。我了解,但我无法将我的应用程序放到 docker Hub 我需要从 azure 命令行创建我的应用程序。我需要带有共享文件夹的 Windows Container,但我不明白我在代码中犯错的地方(应该可以正常工作)。我没有在 Windows Container 中添加参数?为什么 Azure 认为我有 Windows 容器映像(这个正确)但配置 linux(这个错误)?
    • os-typy Window 和 Window Container 不支持文件共享
    • 随时打开支持事件,我们将协助docs.microsoft.com/en-us/azure/azure-portal/supportability/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-27
    • 2021-06-02
    • 1970-01-01
    相关资源
    最近更新 更多