US 12,474,910 B2
Multi-variant image container with optional tagging
Amar Shah, Pune (IN); Akash Chandra, Bengaluru (IN); and Prashant Farkya, Bangalore (IN)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Dec. 26, 2022, as Appl. No. 18/088,664.
Prior Publication US 2024/0211231 A1, Jun. 27, 2024
Int. Cl. G06F 8/61 (2018.01); G06F 9/455 (2018.01)
CPC G06F 8/63 (2013.01) [G06F 9/45558 (2013.01); G06F 2009/45562 (2013.01)] 9 Claims
OG exemplary drawing
 
1. An apparatus, comprising:
a processor that, when executing instructions stored in a memory, is configured to:
receive a request to build an instance of a container image that comprises a plurality of image layers, wherein
the plurality of image layers comprises a plurality of required image layers and one or more optional image layers,
functionality of each of the one or more optional image layers is different from functionality of each of the plurality of required image layers,
functionality of each of the one or more optional image layers is unique,
a first image layer of the plurality of required image layers provides a functionality related to an operating system of a virtual machine,
a second image layer of the plurality of required image layers provides a functionality related to a core feature of an application,
the request comprises a tag identifier, and
the instance of the container image comprises a build file comprising:
a first software instruction to load the operating system of the virtual machine included in the first image layer of the plurality of required image layers;
a second software instruction to run the loaded operating system of the virtual machine;
a third software instruction to load the core feature of the application from the second image layer of the plurality of required image layers; and
one or more tags corresponding to the one or more optional image layers; control a compiler to compile the build file, wherein the compilation of the build file:
associates each of the one or more optional image layers with a corresponding tag, of the one or more tags, that identifies each of the one or more optional image layers as optional, and
generates a manifest that shows the association between each of the one or more optional image layers and the corresponding tag;
build the instance of the container image based on the request and the manifest;
identify, based on a match of the tag identifier in the request to the corresponding tag of at least a first optional image layer of the one or more optional image layers, the at least first optional image layer of the one or more optional image layers for a new instance of the container image deployed in a runtime environment; and
pull, from the container image, a subset of the plurality of image layers to the new instance of the container image, wherein
the subset of the plurality of image layers includes the plurality of required image layers and the identified at least first optional image layer of the one or more optional image layers, and
the subset of the plurality of image layers excludes a second optional image layer of the one or more optional image layers having a tag, of the one or more tags, that does not match the tag identifier.