Mounting Files in a container instance doesn't work "VolumesNotFound"

Kirsten Rode 40 Reputation points
2024-02-19T13:55:23.16+00:00

Hi, I am currently trying to mount some files to my images. My Yaml file looks like this:

version: '3.5'
location: westeurope
name: jitsimeetci
properties:
  imageRegistryCredentials:
  - server: jitsimeet.azurecr.io
    username: JitsiMeet
    password: ***
  containers:
  - name: web 
    properties:
      image: jitsimeet.azurecr.io/web:latest
      resources:
        requests:
          cpu: 1
          memoryInGb: 1.5
      ports:
      - protocol: tcp
        port: 80
      - protocol: tcp
        port: 443
      - protocol: tcp
        port: 22
      environmentVariables:
      - name: AMPLITUDE_ID
        value: AMPLITUDE_ID
      volumeMounts: # Array of volume mounts for the instance
      - name: config
        mountPath: /web/
      - name: crontabs
        mountPath: /web/crontabs/
      - name: transcripts
        mountPath: /transcripts/
  restartPolicy: always
  osType: Linux
  ipAddress:
    type: Public
    ports:
    - protocol: tcp
      port: 80
    - protocol: tcp
      port: 443
    - protocol: udp
      port: 10000
    - protocol: tcp
      port: 22
    - protocol: tcp
      port: 5349
  volumes:
  - name: metisjitsi
    azureFile:
      sharename: metisjitsi
      storageAccountName: metisstorage
      storageAccountKey: ***

If i am using the command az container create --resource-group Metis --file docker-compose.yml I get the error (VolumesNotFound) Volumes 'config,crontabs,transcripts' in container 'web'are not found. Code: VolumesNotFound Message: Volumes 'config,crontabs,transcripts' in container 'web'are not found. But i don't know why. I have double checked where i stored my files and everything seems to be okay. I also should be having enough acces to acces the storage file, as i was the one who created it. I am not entirely sure if the name might be important? Because it says it couldn't find the volume mounts in the container, even thought i think it should be searching for the volume mounts in the storage file?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
656 questions
{count} votes

Accepted answer
  1. AlaaBarqawi_MSFT 942 Reputation points Microsoft Employee
    2024-02-21T08:36:22.3366667+00:00

    Hi Kirsten Rode, you need to mount multiple time for the same storage account try to use this YAML in your app and you need to create 3 shares in your storage account User's image

    version: '3.5'
    location: eastus
    name: jitsimeetci
    properties:
      containers:
        - name: web 
          properties:
            image: jitsi/web
            resources:
              requests:
                cpu: 1
                memoryInGb: 1.5
            ports:
              - protocol: tcp
                port: 80
              - protocol: tcp
                port: 443
              - protocol: tcp
                port: 22
            environmentVariables:
              - name: AMPLITUDE_ID
                value: AMPLITUDE_ID
            volumeMounts:
              - name: config
                mountPath: /web/
              - name: crontabs
                mountPath: /web/crontabs/
              - name: transcripts
                mountPath: /transcripts/
      restartPolicy: always
      osType: Linux
      ipAddress:
        type: Public
        ports:
          - protocol: tcp
            port: 80
          - protocol: tcp
            port: 443
          - protocol: udp
            port: 10000
          - protocol: tcp
            port: 22
          - protocol: tcp
            port: 5349
      volumes:
        - name: config
          azureFile:
            sharename: config
            storageAccountName: metisjitsi
            storageAccountKey: 0000000
        - name: crontabs
          azureFile:
            sharename: crontabs
            storageAccountName: metisjitsi
            storageAccountKey: 00000000
        - name: transcripts
          azureFile:
            sharename: transcripts
            storageAccountName: metisjitsi
            storageAccountKey: 000000
    

0 additional answers

Sort by: Most helpful