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

Function inspect

src/spec-shutdown/dockerUtils.ts:138–156  ·  view source on GitHub ↗
(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, type: 'container' | 'image' | 'volume', ids: string[])

Source from the content-addressed store, hash-verified

136}
137
138async function inspect<T>(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, type: 'container' | 'image' | 'volume', ids: string[]): Promise<T[]> {
139 if (!ids.length) {
140 return [];
141 }
142 const partial = toExecParameters(params);
143 const result = await runCommandNoPty({
144 ...partial,
145 args: (partial.args || []).concat(['inspect', '--type', type, ...ids]),
146 });
147 try {
148 return JSON.parse(result.stdout.toString());
149 } catch (err) {
150 console.error({
151 stdout: result.stdout.toString(),
152 stderr: result.stderr.toString(),
153 });
154 throw err;
155 }
156}
157
158export async function listContainers(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, all = false, labels: string[] = []) {
159 const filterArgs = [];

Callers

nothing calls this directly

Calls 2

runCommandNoPtyFunction · 0.90
toExecParametersFunction · 0.85

Tested by

no test coverage detected