Docker Compose online guides describe the profiles feature that allows to run different containers described in the same configuration file just using different profiles with option --profile
: here (in short) and here (in details).
The profiles
compose file option (describing for which profiles a service should run) is mentioned in compose file 3.0 format specification without any other version restrictions, so it looks like it should work for all 3.* versions.
But the instances of Docker Compose that I have installed on my Windows workstation and on my dev server under CentOS 7 (both has version 1.27.4, build 40524192) just doesn't have this option in their CLI. The docker-compose --help
command shows no --profile
option in its output, and it really doesn't work when I try it. Instead, there are --context
and --env-file
options (that are absent in the online guide), but it looks like both are something different.
Does anyone know what's happened with Docker Compose profiles? Are this feature removed (I was unable to find anything about it)? Or are they available in different mode or something (I know that some options work only for docker stack
, not for docker-compose
, but the former one doesn't have it too neighter in online descrition nor in --help
output)? Or do I do something wrong?