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

Function extraRunArgs

src/spec-node/singleContainer.ts:327–340  ·  view source on GitHub ↗
(common: ResolverParameters, params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig)

Source from the content-addressed store, hash-verified

325}
326
327export async function extraRunArgs(common: ResolverParameters, params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig) {
328 const extraArguments: string[] = [];
329 if (config.hostRequirements?.gpu) {
330 if (await checkDockerSupportForGPU(params)) {
331 common.output.write(`GPU support found, add GPU flags to docker call.`);
332 extraArguments.push('--gpus', 'all');
333 } else {
334 if (config.hostRequirements?.gpu !== 'optional') {
335 common.output.write('No GPU support found yet a GPU was required - consider marking it as "optional"', LogLevel.Warning);
336 }
337 }
338 }
339 return extraArguments;
340}
341
342export async function spawnDevContainer(params: DockerResolverParameters, config: DevContainerFromDockerfileConfig | DevContainerFromImageConfig, mergedConfig: MergedDevContainerConfig, imageName: string, labels: string[], workspaceMount: string | undefined, additionalMountString: string | undefined, imageDetails: () => Promise<ImageDetails>, containerUser: string | undefined, extraLabels: Record<string, string>) {
343 const { common } = params;

Callers 1

spawnDevContainerFunction · 0.85

Calls 2

checkDockerSupportForGPUFunction · 0.90
writeMethod · 0.65

Tested by

no test coverage detected