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

Function startExistingContainer

src/spec-node/singleContainer.ts:304–319  ·  view source on GitHub ↗
(params: DockerResolverParameters, labels: string[], container: ContainerDetails)

Source from the content-addressed store, hash-verified

302}
303
304async function startExistingContainer(params: DockerResolverParameters, labels: string[], container: ContainerDetails) {
305 const { common } = params;
306 const start = container.State.Status !== 'running';
307 if (start) {
308 const starting = 'Starting container';
309 const start = common.output.start(starting);
310 const infoParams = { ...toExecParameters(params), output: makeLog(common.output, LogLevel.Info), print: 'continuous' as 'continuous' };
311 await dockerCLI(infoParams, 'start', container.Id);
312 common.output.stop(starting, start);
313 let startedContainer = await findDevContainer(params, labels);
314 if (!startedContainer) {
315 bailOut(common.output, 'Dev container not found.');
316 }
317 }
318 return start;
319}
320
321export async function findDevContainer(params: DockerCLIParameters | DockerResolverParameters, labels: string[]): Promise<ContainerDetails | undefined> {
322 const ids = await listContainers(params, true, labels);

Callers 1

Calls 7

toExecParametersFunction · 0.90
makeLogFunction · 0.90
dockerCLIFunction · 0.90
findDevContainerFunction · 0.85
bailOutFunction · 0.85
startMethod · 0.80
stopMethod · 0.80

Tested by

no test coverage detected