Generate variant build context folder named after tag instead of organized by distro, when distro is specified.
Closed this issue · 0 comments
leojonathanoh commented
Current
Generate variant build context folder is organized by $VARIANT['distro']
.
Build context folder is /variants/<distro>/$VARIANT['tag_without_distro']
.
Expectation
Generate variant build context folder is named after the $VARIANT['tag']
.
Build context folder is simply /variants/$VARIANT['tag']
.
Discussion
E.g. when a variant distro is specified, the variant build context folder looks like:
└── variants
| └── $VARIANT['distro']
| └── $VARIANT['tag_without_distro']
| └── Dockerfile
when it would be more intuitive to simply be
└── variants
| └── $VARIANT['tag']
| └── Dockerfile
Benefits
- Single level tree is easier to follow
- Single level tree matches flat hierarchy of image registries e.g. docker hub, which does not use a tree structure
- Intuitive to browse for build context folders, since they are named after tags
- CI files and CI build job logs show that the build context folder matches the tag, improving traceability and debuggability
- A tag with
$VARIANTS['distro']
not being in the prefix or suffix position will not generate an build context folder of an unpredictable name. For instance, a tag such asfoo-<distro>-bar
will no longer be generated as/variants/<distro>/foo-bar
, which is unintuitive, since the tag