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

Function buildNamedImageAndExtend

src/spec-node/singleContainer.ts:113–122  ·  view source on GitHub ↗
(params: DockerResolverParameters, configWithRaw: SubstitutedConfig<DevContainerFromDockerfileConfig | DevContainerFromImageConfig>, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean, argImageNames?: string[])

Source from the content-addressed store, hash-verified

111 return 'image' in config && config.image ? config.image : getFolderImageName(params.common);
112}
113export async function buildNamedImageAndExtend(params: DockerResolverParameters, configWithRaw: SubstitutedConfig<DevContainerFromDockerfileConfig | DevContainerFromImageConfig>, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean, argImageNames?: string[]): Promise<{ updatedImageName: string[]; imageMetadata: SubstitutedConfig<ImageMetadataEntry[]>; imageDetails: () => Promise<ImageDetails>; labels?: Record<string, string> }> {
114 const { config } = configWithRaw;
115 const imageNames = argImageNames ?? [getDefaultName(config, params)];
116 params.common.progress(ResolverProgress.BuildingImage);
117 if (isDockerFileConfig(config)) {
118 return await buildAndExtendImage(params, configWithRaw as SubstitutedConfig<DevContainerFromDockerfileConfig>, imageNames, params.buildNoCache ?? false, additionalFeatures);
119 }
120 // image-based dev container - extend
121 return await extendImage(params, configWithRaw, imageNames[0], argImageNames || [], additionalFeatures, canAddLabelsToContainer);
122}
123
124async function buildAndExtendImage(buildParams: DockerResolverParameters, configWithRaw: SubstitutedConfig<DevContainerFromDockerfileConfig>, baseImageNames: string[], noCache: boolean, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>) {
125 const { cliHost, output } = buildParams.common;

Callers 2

doBuildFunction · 0.90

Calls 4

extendImageFunction · 0.90
getDefaultNameFunction · 0.85
isDockerFileConfigFunction · 0.85
buildAndExtendImageFunction · 0.85

Tested by

no test coverage detected