How to Add "xyz" to Docker volumes and Containers

When running instance today, it uses the default naming from Ozone for volumes and containers. For examples:

Volumes: Name
Ozon-mysql-data
Ozon-config

Containers
ozon-substitution-1

The objective of this is to modify the Ozone build and Docker Compose files to add "xyz " to volumes and containers to clearly identify them as part of the xyz project . Your help is much appreciated.

Generally, you can simply add a name property to the volumes

services:
  ozone:
    ...
    volumes:
      Ozon-mysel-data:/container/mount/path
      Ozon-config:/another/mount/path

volumes:
  Ozon-mysql-data:
    name: Ozon-mysql-data-xyz
  Ozon-config:
    name: Ozon-config-xyz  
1 Like

Thanks @deanayalon for your immediate response, unfortunately this docker compose file is generated by pom.xml, so its not straight forward, Am still abit perplexed of how to come over this.

Post it here then, I canā€™t help you blind

Here is the pom file <?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/ - Pastebin.com

I donā€™t know what that is, you said you want to edit the Compose file so that the volumes are named differently, post the compose file

If you generate compose projects or run containers from a Java application, your question would be better on a Java community forum, but if you understand the pom file, @deanayalonā€™s answer should help you to implement it. As I see the pom file uses regular expressions to find where some parts should be added.