3

This is related to Docker-compose, conditional statements? (e.g. add volume only if condition) question but I prefer to ask a new one because my problem is a bit different:
I have a docker-compose.yml with multiple services and multiple storage.
I'd deploy it locally or on Azure ACI.
I'd like to have only one docker-compose.yml , but Azure ACI needs to specify the storage driver:

  mysql-data:
    driver: azure_file
      driver_opts:
        share_name: mysql
        storage_account_name: mystore

obviously the driver does not exist locally.
Using a variable for the driver like:

  mysql-data:
    driver: ${STORAGE_DRIVER}
      driver_opts:
        share_name: mysql
        storage_account_name: mystore

Gives an error because the local overlay2 driver doesn't have share_name nor storage_account_name properties.

How can I achieve my problem and keeping only one docker-compose.yml multi-containers deployement ?
Thank you.

Albert Tinon
  • 136
  • 5

1 Answers1

0

After a while I found that there is solution for conditional statements in docker compose… The only workaround is tu use some sed / awk modification

Albert Tinon
  • 136
  • 5