How do I create permanent volumes using Compose File? (Azure Container Instance)

IT-Geek 1 Reputation point
2022-02-28T19:08:06.127+00:00

I am in the process of deploying an application using ACI on Azure. I generate the container using the so-called Compose file (Docker). Using my YML file (version 3), the images are formed and the instance is also created. However, Azure still seems to have problems with the creation of the volumes listed in the YML file. The storage account and file share already exist.
I would now like to create the folders for the volumes in the file share. However, it only creates one of eight folders (only the Git folder). Because of this some services can not be initialized/started, because they need the volumes/folders.

Below you can see my YML file:

Translated with www.DeepL.com/Translator (free version):

version: '3'
services:

sql:
    image: registry.azurecr.io/sql
    ports: 
    - "4663"
    volumes:
    - sql-init:/docker-entrypoint-initdb.d
    - sql-data:/var/lib/sqlql/data/
    depends_on:
    - Application1
    environment:
    - SERVER_NAME="localhost"
    - SERVER_DESC="Application1 docker-compose server"
    - REPOSITORY_URL="http://git/git/Application1"
git:
    image: registry.azurecr.io/gitserver
    ports: 
    - "3554:3554" 
    volumes:
    - git-data:/var/opt/git/
    - git-config:/etc/subversion/
    depends_on:
    - sql
appSrv:
    image: registry.azurecr.io/appSrv16
    ports: 
    - "80:80"
    - "35684:35684"
    - "4266"
    environment:
    - EXTERNAL_HOST_NAME=localhost
    - EXTERNAL_HOST_PORT=80
    - DB_SCHEMA=dbSchema
    links:
    - sql:db
    - git:git
    volumes:
    - deployments:/opt/jboss/appSrv/standalone/deployments/
    - app1-home:/home/app1
    - jboss-config:/opt/jboss/appSrv/standalone/configuration/   
    - clients:/home/clients/   
    - interface-init:/home/interface-init          
    depends_on:
    - sql
    - app1
    - appSrv-init 
app1:  # Container is used for volumes initialization only - exits immediately.
    image: registry.azurecr.io/app1612
    entrypoint: /home/volumes_init.sh
    environment:
    - EXTERNAL_HOST_NAME=localhost
    - EXTERNAL_HOST_PORT=6060
    - EXTERNAL_HOST_git_PORT=80
    - DEFAULT_WORKSPACE=false
    - WS_ONLY=false
    volumes:
    - clients:/clients:rw
    - deployments:/deployments:rw
    - app1-home:/app1:rw
    - sql-init:/home/sql_init:rw
    - interface-init:/interface-init:rw
appSrv-init: # Container is used for initialization of appSrv configuration - exits immediately.
    image: registry.azurecr.io/appSrv16_init
    volumes:       
    - jboss-config:/configuration

volumes:
sql-data: # Database data
driver: azure_file
driver_opts:
share_name: fileshare1
storage_account_name: storageaccount

sql-init: # Initialization SQL scripts for database
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

deployments: # Deployments folder of an application server
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

app1-home: # App 1 home folder
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

jboss-config: # JBoss folder configuration
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

clients: # Contains archive with preconfigurated client environment
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

git-data: # git data folder
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

git-config: # git configuration folder
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount

interface-init: # Folder for custom changes of deployment and client archive
    driver: azure_file
    driver_opts:
        share_name: fileshare1
        storage_account_name: storageaccount
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
669 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,871 questions
{count} votes

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,551 Reputation points Microsoft Employee
    2022-03-16T09:16:28.963+00:00

    Hi @IT-Geek ,
    Firstly, apologies for the delay in response. I was waiting to hear back from the necessary Team on this.
    Are you still facing this issue?
    If yes, can you please check this document for reference on how ACI mounts a file share. Reference document - https://video2.skills-academy.com/en-us/azure/container-instances/container-instances-volume-azure-files.

    There is a note at the top that might be relevant in this case.

    183656-2022-03-16-14-45-14-clipboard.png

    Let me know if this helps.