Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Compose profiles feature: deprecated?

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?

like image 961
bboogwin Avatar asked Jun 25 '26 21:06

bboogwin


1 Answers

As clcto answered, the version of Docker Compose that I used is just too old: to use profiles, version 1.28.0 or later is required.

For Windows, the usual way to receive Docker Compose is to install Docker Desktop that contains Docker, Docker Compose and more, and the actual version of Docker Desktop still contains Docker Compose 1.27.4. As a workaround, I downloaded corresponding Docker Compose exe file from here and replaced the existing c:\Program Files\Docker\Docker\resources\bin\docker-compose.exe file with it — it was enough.

like image 174
bboogwin Avatar answered Jun 28 '26 18:06

bboogwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!