There are two articles describing using environment variable but my use case is different.
I have docker-compose file where I have 3-7 containers. Depends on situation.
version: '2' services: db: image: example/db backend: image: example/server frontend: image: example/gui
Now, in above example all my images will use latest version, but I would like to control which version to deploy, therefore I want to define some variable version and use it in all my images, something like:
version: '2' variable version=1.0.1 services: db: image: example/db:$version backend: image: example/server:$version frontend: image: example/gui:$version
Second example is wrong, but it shows my need what I want to achieve