From the official Docker Compose build doc:
If you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image:
Example:
build:
...
image: myapp:tag
but I would like to replace tag with the output of git rev-parse --short HEAD.
Ideally I need something like:
image: myapp:$(git rev-parse --short HEAD)