-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Feature] Long syntax for images names #13704
Description
Description
I am currently building & running images in CI using this pattern:
- compose file:
services:
my:
image: myimage:${VERSION}
build:
args:
VERSION: ${VERSION}
tags:
- myimage:${VERSION}
- myimage:latest.envfile:
VERSION=1.0.0
Then I use a (renovate) bot to bump the version number automatically in my CI whenever the upstream package is updated.
Ideally, I would prefer putting the version number in the compose file using an extension & anchor, and then use the version number later in the compose file using aliases. But I can't because I have to "compute" the full image name from the version anchor, and I can't find a way to do that.
In fact, I would like to do something like this:
x-version: &version 1.0.0
services:
my:
image:
name: myimage
tag: *version
build:
args:
VERSION: *version
tags:
- name: myimage
tag: *version
- name: myimage
tag: latestNote 1: not sure about if the attribute name is named appropriately, maybe use repository or something else?
Note 2: in fact the same problem occur for all the other "composite" fields that don't have long syntax
The end purpose is to have a self-contained compose file that can be easily updated by my "dependency update" bot.