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

Function doBuild

src/spec-node/devContainersSpecCLI.ts:580–784  ·  view source on GitHub ↗
({
	'user-data-folder': persistedFolder,
	'docker-path': dockerPath,
	'docker-compose-path': dockerComposePath,
	'workspace-folder': workspaceFolderArg,
	config: configParam,
	'log-level': logLevel,
	'log-format': logFormat,
	'no-cache': buildNoCache,
	'image-name': argImageName,
	'cache-from': addCacheFrom,
	'buildkit': buildkit,
	'platform': buildxPlatform,
	'push': buildxPush,
	'label': buildxLabel,
	'output': buildxOutput,
	'cache-to': buildxCacheTo,
	'additional-features': additionalFeaturesJson,
	'skip-feature-auto-mapping': skipFeatureAutoMapping,
	'skip-persisting-customizations-from-features': skipPersistingCustomizationsFromFeatures,
	'experimental-lockfile': experimentalLockfile,
	'experimental-frozen-lockfile': experimentalFrozenLockfile,
	'no-lockfile': noLockfile,
	'frozen-lockfile': frozenLockfile,
	'omit-syntax-directive': omitSyntaxDirective,
}: BuildArgs)

Source from the content-addressed store, hash-verified

578}
579
580async function doBuild({
581 'user-data-folder': persistedFolder,
582 'docker-path': dockerPath,
583 'docker-compose-path': dockerComposePath,
584 'workspace-folder': workspaceFolderArg,
585 config: configParam,
586 'log-level': logLevel,
587 'log-format': logFormat,
588 'no-cache': buildNoCache,
589 'image-name': argImageName,
590 'cache-from': addCacheFrom,
591 'buildkit': buildkit,
592 'platform': buildxPlatform,
593 'push': buildxPush,
594 'label': buildxLabel,
595 'output': buildxOutput,
596 'cache-to': buildxCacheTo,
597 'additional-features': additionalFeaturesJson,
598 'skip-feature-auto-mapping': skipFeatureAutoMapping,
599 'skip-persisting-customizations-from-features': skipPersistingCustomizationsFromFeatures,
600 'experimental-lockfile': experimentalLockfile,
601 'experimental-frozen-lockfile': experimentalFrozenLockfile,
602 'no-lockfile': noLockfile,
603 'frozen-lockfile': frozenLockfile,
604 'omit-syntax-directive': omitSyntaxDirective,
605}: BuildArgs) {
606 warnDeprecatedLockfileFlags(experimentalLockfile, experimentalFrozenLockfile);
607 const effectiveFrozenLockfile = frozenLockfile || experimentalFrozenLockfile;
608
609 const disposables: (() => Promise<unknown> | undefined)[] = [];
610 const dispose = async () => {
611 await Promise.all(disposables.map(d => d()));
612 };
613 try {
614 const workspaceFolder = workspaceFolderArg ? path.resolve(process.cwd(), workspaceFolderArg) : process.cwd();
615 const configFile: URI | undefined = configParam ? URI.file(path.resolve(process.cwd(), configParam)) : undefined;
616 const overrideConfigFile: URI | undefined = /* overrideConfig ? URI.file(path.resolve(process.cwd(), overrideConfig)) : */ undefined;
617 const addCacheFroms = addCacheFrom ? (Array.isArray(addCacheFrom) ? addCacheFrom as string[] : [addCacheFrom]) : [];
618 const additionalFeatures = additionalFeaturesJson ? jsonc.parse(additionalFeaturesJson) as Record<string, string | boolean | Record<string, string | boolean>> : {};
619 const params = await createDockerParams({
620 dockerPath,
621 dockerComposePath,
622 containerDataFolder: undefined,
623 containerSystemDataFolder: undefined,
624 workspaceFolder,
625 mountWorkspaceGitRoot: false,
626 mountGitWorktreeCommonDir: false,
627 configFile,
628 overrideConfigFile,
629 logLevel: mapLogLevel(logLevel),
630 logFormat,
631 log: text => process.stderr.write(text),
632 terminalDimensions: /* terminalColumns && terminalRows ? { columns: terminalColumns, rows: terminalRows } : */ undefined, // TODO
633 defaultUserEnvProbe: 'loginInteractiveShell',
634 removeExistingContainer: false,
635 buildNoCache,
636 expectExistingContainer: false,
637 postCreateEnabled: false,

Callers 1

buildFunction · 0.85

Calls 15

createDockerParamsFunction · 0.90
mapLogLevelFunction · 0.90
workspaceFromPathFunction · 0.90
uriToFsPathFunction · 0.90
buildNamedImageAndExtendFunction · 0.90
readDockerComposeConfigFunction · 0.90
getProjectNameFunction · 0.90

Tested by

no test coverage detected