无法将卷连接到 Azure 容器实例



我尝试使用YAML文件和Azure CLI在Azure容器实例中部署我的Rasa聊天机器人。虽然使用本地wsl2卷路径/var/lib/docker/volumes/可以在本地顺利运行,但在云中出现以下问题:

在rasa/rasa:3.x。有一个dockerfile层,它创建一个包含元数据和python签名的Volume/tmp。但是当我将图像上传到云端时,虽然似乎与Azure文件共享有连接,但没有创建这个/tmp文件夹。如下图所示,在ACI的属性中,文件共享卷似乎运行良好。

ACI与Azure文件共享连接

空Azure文件共享目录

Docker VOLUME [/tmp] layer

下面是我的部署目录。用于:创建可用分区容器——资源组——文件部署-aci.yml

apiVersion: '2019-12-01'
location: northeurope
name: rasa-core-server
properties:
containers:
- name: rasa-core-server
properties:
environmentVariables: []
image: rasaregistry.azurecr.io/rasa-core-server:1.0.0   
ports:
- port: 5005
resources:
requests:
cpu: 2
memoryInGB: 8
gpu:
count: 1
sku: K80          
volumeMounts:
- mountPath: /rastorage
name: rasa-storage
osType: Linux
restartPolicy: Always
ipAddress:
type: Public
ports:
- port: 5005
dnsNameLabel: rasa-core-server
imageRegistryCredentials:
- server: rasaregistry.azurecr.io
username: test123
password: test456 
volumes:
- name: rasa-storage
azureFile:
sharename: rasa-storage
storageAccountName: test123
storageAccountKey: test456
tags: {}
type: Microsoft.ContainerInstance/containerGroups

是否有一些我错过挂载文件共享卷到Linux Azure容器实例?

我已经阅读了关于使用Azure文件共享挂载的文档https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files

任何帮助都是感激的!

但我上传图片到云的时候,虽然似乎有与Azure文件共享连接时,没有创建/tmp文件夹。

/tmp文件夹映射到您的主机,即使您正在拍摄运行容器的映像,您也无法将/tmp文件夹保存为映像,并且无法在Azure容器实例中看到。

只有分区或文件夹,您已经创建了本地容器可以能够看到在Azure容器实例,因为它们没有映射/附有您的主机。

除了上面的建议之外,还有一个更重要的事情需要注意:下面的建议来自在Azure容器实例中挂载Azure文件共享

如果您将共享挂载到一个容器目录中,其中文件或目录存在,挂载模糊了文件或目录,使得当容器运行时,它们不可访问。

最新更新