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

Function provision

src/spec-node/devContainersSpecCLI.ts:185–318  ·  view source on GitHub ↗
({
	'user-data-folder': persistedFolder,
	'docker-path': dockerPath,
	'docker-compose-path': dockerComposePath,
	'container-data-folder': containerDataFolder,
	'container-system-data-folder': containerSystemDataFolder,
	'workspace-folder': workspaceFolderArg,
	'workspace-mount-consistency': workspaceMountConsistency,
	'gpu-availability': gpuAvailability,
	'mount-workspace-git-root': mountWorkspaceGitRoot,
	'mount-git-worktree-common-dir': mountGitWorktreeCommonDir,
	'id-label': idLabel,
	config,
	'override-config': overrideConfig,
	'log-level': logLevel,
	'log-format': logFormat,
	'terminal-rows': terminalRows,
	'terminal-columns': terminalColumns,
	'default-user-env-probe': defaultUserEnvProbe,
	'update-remote-user-uid-default': updateRemoteUserUIDDefault,
	'remove-existing-container': removeExistingContainer,
	'build-no-cache': buildNoCache,
	'expect-existing-container': expectExistingContainer,
	'skip-post-create': skipPostCreate,
	'skip-non-blocking-commands': skipNonBlocking,
	prebuild,
	mount,
	'remote-env': addRemoteEnv,
	'cache-from': addCacheFrom,
	'cache-to': addCacheTo,
	'buildkit': buildkit,
	'additional-features': additionalFeaturesJson,
	'skip-feature-auto-mapping': skipFeatureAutoMapping,
	'skip-post-attach': skipPostAttach,
	'dotfiles-repository': dotfilesRepository,
	'dotfiles-install-command': dotfilesInstallCommand,
	'dotfiles-target-path': dotfilesTargetPath,
	'container-session-data-folder': containerSessionDataFolder,
	'omit-config-remote-env-from-metadata': omitConfigRemotEnvFromMetadata,
	'secrets-file': secretsFile,
	'experimental-lockfile': experimentalLockfile,
	'experimental-frozen-lockfile': experimentalFrozenLockfile,
	'no-lockfile': noLockfile,
	'frozen-lockfile': frozenLockfile,
	'omit-syntax-directive': omitSyntaxDirective,
	'include-configuration': includeConfig,
	'include-merged-configuration': includeMergedConfig,
}: ProvisionArgs)

Source from the content-addressed store, hash-verified

183}
184
185async function provision({
186 'user-data-folder': persistedFolder,
187 'docker-path': dockerPath,
188 'docker-compose-path': dockerComposePath,
189 'container-data-folder': containerDataFolder,
190 'container-system-data-folder': containerSystemDataFolder,
191 'workspace-folder': workspaceFolderArg,
192 'workspace-mount-consistency': workspaceMountConsistency,
193 'gpu-availability': gpuAvailability,
194 'mount-workspace-git-root': mountWorkspaceGitRoot,
195 'mount-git-worktree-common-dir': mountGitWorktreeCommonDir,
196 'id-label': idLabel,
197 config,
198 'override-config': overrideConfig,
199 'log-level': logLevel,
200 'log-format': logFormat,
201 'terminal-rows': terminalRows,
202 'terminal-columns': terminalColumns,
203 'default-user-env-probe': defaultUserEnvProbe,
204 'update-remote-user-uid-default': updateRemoteUserUIDDefault,
205 'remove-existing-container': removeExistingContainer,
206 'build-no-cache': buildNoCache,
207 'expect-existing-container': expectExistingContainer,
208 'skip-post-create': skipPostCreate,
209 'skip-non-blocking-commands': skipNonBlocking,
210 prebuild,
211 mount,
212 'remote-env': addRemoteEnv,
213 'cache-from': addCacheFrom,
214 'cache-to': addCacheTo,
215 'buildkit': buildkit,
216 'additional-features': additionalFeaturesJson,
217 'skip-feature-auto-mapping': skipFeatureAutoMapping,
218 'skip-post-attach': skipPostAttach,
219 'dotfiles-repository': dotfilesRepository,
220 'dotfiles-install-command': dotfilesInstallCommand,
221 'dotfiles-target-path': dotfilesTargetPath,
222 'container-session-data-folder': containerSessionDataFolder,
223 'omit-config-remote-env-from-metadata': omitConfigRemotEnvFromMetadata,
224 'secrets-file': secretsFile,
225 'experimental-lockfile': experimentalLockfile,
226 'experimental-frozen-lockfile': experimentalFrozenLockfile,
227 'no-lockfile': noLockfile,
228 'frozen-lockfile': frozenLockfile,
229 'omit-syntax-directive': omitSyntaxDirective,
230 'include-configuration': includeConfig,
231 'include-merged-configuration': includeMergedConfig,
232}: ProvisionArgs) {
233
234 warnDeprecatedLockfileFlags(experimentalLockfile, experimentalFrozenLockfile);
235 const effectiveFrozenLockfile = frozenLockfile || experimentalFrozenLockfile;
236
237 const workspaceFolder = workspaceFolderArg ? path.resolve(process.cwd(), workspaceFolderArg) : undefined;
238 const addRemoteEnvs = addRemoteEnv ? (Array.isArray(addRemoteEnv) ? addRemoteEnv as string[] : [addRemoteEnv]) : [];
239 const addCacheFroms = addCacheFrom ? (Array.isArray(addCacheFrom) ? addCacheFrom as string[] : [addCacheFrom]) : [];
240 const additionalFeatures = additionalFeaturesJson ? jsonc.parse(additionalFeaturesJson) as Record<string, string | boolean | Record<string, string | boolean>> : {};
241 const providedIdLabels = idLabel ? Array.isArray(idLabel) ? idLabel as string[] : [idLabel] : undefined;
242

Callers

nothing calls this directly

Calls 10

getCLIHostFunction · 0.90
mapLogLevelFunction · 0.90
envListToObjFunction · 0.90
readSecretsFromFileFunction · 0.85
doProvisionFunction · 0.85
resolveFunction · 0.85
writeMethod · 0.65
execMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected