-
Notifications
You must be signed in to change notification settings - Fork 42
Description
May relate to #301.
Currently many containers have some sort of OS assumption baked into their 'default' tags, and the present various other decisions (OS, libc, etc) as sub-tags related to that base tag. Take the dotnet/aspnet image for example:
you've got:
- the default debian bookworm image
- alpine
- alpine 3.17 (same alpine version, just more explicit)
- slim debian bookworm
- ubuntu jammy
- slim ubuntu jammy
It would be great if we could keep most of the inference in place but allow users to switch OS/libc/etc with a suffix switch like ContainerBaseImageTagSuffix
. The logic would be
- If inferring a base image at all (meaning the user didn't provide a ContainerBaseImage)
- and the ContainerBaseImageTagSuffix is present
- ContainerBaseImage should be set to the inferred
_ContainerBaseRegistry
followed by the inferred_ContainerBaseImageName
, with the inferred_ContainerBaseImageTag
and finally theContainerBaseImageTagSuffix
:
<ContainerBaseImage Condition="'$(_ContainerIsUsingMicrosoftDefaultImages)' == 'true'">$(_ContainerBaseRegistry)/$(_ContainerBaseImageName):$(_ContainerBaseImageTag)$(ContainerBaseImageTagSuffix)</ContainerBaseImage>
This works great for the MS-supplied/inferred images, but it wouldn't work so well in the general case (when a user wants to set a base image and separately manage the tag suffix), therefore if the user isn't using our inference AND there is a ContainerBaseImage and ContainerBaseImageTagSuffix, then the two should be concat'd together.