I want my application to know which version of the image it is running on.
The idea was to pass the Docker image tag to the image as an environment variable. However, I do not want to change the version number in the image and in the ENV variable all the time.
Example:
version: "3"
VERSION=0.2.3
services:
app:
image: myimage:$VERSION
environment:
- APPLICATION_VERSION:$VERSION
Can variables be declared to update all values together, or is there any other solution?
source
share