Volume Naming

When creating named volumes, Docker Compose will prepend the project name, which is the current directory name by default, to the volume name. In other words, if you have a Docker Compose install under the folder srm-docker and another under srm-docker-2, their volume names will be distinct and contain different data. Without specifying the -p option, the following two named volumes would exist:
  • srm-docker_codedx-appdata-volume
  • srm-docker-2_codedx-appdata-volume

Named volumes are created when doing docker-compose up, so if you want to override the default naming, you need to specify a project name the first time you execute the following command:

docker-compose -p srm -f ./docker-compose.yml up