By default, Compose bases the project name on basename of the directory compose commands are run from. The project name can be overridden either by passing a -p / --project-name
option for each command or setting the COMPOSE_PROJECT_NAME
environment variable.
Can I run docker-compose with an empty project-name? I declare the volume with the name: myvolume and I would like to have the name myvolume
after starting the container and not e.g. user_myvolume
. Is it possible?
It's not possible to have an empty project name as it's used internally by docker as part of the key for container.
It's discussed in more detail here: Proposal: support for empty project names.