容器映像不支持容器组指定的OS'Linux'

时间:2020-07-01 18:38:08

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

我想用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:~$

1 个答案:

答案 0 :(得分:2)

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

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

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

相关问题