MCPcopy Index your code
hub / github.com/devcontainers/cli / getExtendImageBuildInfo

Function getExtendImageBuildInfo

src/spec-node/containerFeatures.ts:141–170  ·  view source on GitHub ↗
(params: DockerResolverParameters, config: SubstitutedConfig<DevContainerConfig>, baseName: string, imageBuildInfo: ImageBuildInfo, composeServiceUser: string | undefined, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean)

Source from the content-addressed store, hash-verified

139}
140
141export async function getExtendImageBuildInfo(params: DockerResolverParameters, config: SubstitutedConfig<DevContainerConfig>, baseName: string, imageBuildInfo: ImageBuildInfo, composeServiceUser: string | undefined, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean): Promise<{ featureBuildInfo?: ImageBuildOptions; featuresConfig?: FeaturesConfig; labels?: Record<string, string> } | undefined> {
142
143 // Creates the folder where the working files will be setup.
144 const dstFolder = await createFeaturesTempFolder(params.common);
145
146 // Processes the user's configuration.
147 const platform = params.common.cliHost.platform;
148
149 const cacheFolder = await getCacheFolder(params.common.cliHost);
150 const { noLockfile, frozenLockfile } = params;
151 const featuresConfig = await generateFeaturesConfig({ ...params.common, platform, cacheFolder, noLockfile, frozenLockfile }, dstFolder, config.config, additionalFeatures);
152 if (!featuresConfig) {
153 if (canAddLabelsToContainer && !imageBuildInfo.dockerfile) {
154 return {
155 labels: {
156 [imageMetadataLabel]: JSON.stringify(getDevcontainerMetadata(imageBuildInfo.metadata, config, undefined, [], getOmitDevcontainerPropertyOverride(params.common)).raw),
157 }
158 };
159 }
160 return { featureBuildInfo: await getImageBuildOptions(params, config, dstFolder, baseName, imageBuildInfo) };
161 }
162
163 // Generates the end configuration.
164 const featureBuildInfo = await getFeaturesBuildOptions(params, config, featuresConfig, baseName, imageBuildInfo, composeServiceUser);
165 if (!featureBuildInfo) {
166 return undefined;
167 }
168 return { featureBuildInfo, featuresConfig };
169
170}
171
172// NOTE: only exported to enable testing. Not meant to be called outside file.
173export function generateContainerEnvsV1(featuresConfig: FeaturesConfig) {

Callers 3

buildAndExtendImageFunction · 0.90
extendImageFunction · 0.85

Calls 7

createFeaturesTempFolderFunction · 0.90
getCacheFolderFunction · 0.90
generateFeaturesConfigFunction · 0.90
getDevcontainerMetadataFunction · 0.90
getImageBuildOptionsFunction · 0.85
getFeaturesBuildOptionsFunction · 0.85

Tested by

no test coverage detected