When I set up a couple of Docker containers in docker-compose.yaml
file with links, the name of the containers ends up being of the format prefix_%s_1
According to docker compose issue #745:
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.
You can set the prefix of your choice to your container names by writing something like this:
$ docker-compose -p MY_PROJECT_NAME
which is the equivalent to (the more readable):
$ docker-compose --project-name MY_PROJECT_NAME