MCPcopy Create free account
hub / github.com/METR/vivaria / listContainers

Method listContainers

server/src/docker/docker.ts:217–229  ·  view source on GitHub ↗
(opts: { all?: boolean; filter?: string; format: string })

Source from the content-addressed store, hash-verified

215 }
216
217 async listContainers(opts: { all?: boolean; filter?: string; format: string }): Promise<string[]> {
218 const stdout = (
219 await this.runDockerCommand(
220 cmd`docker container ls
221 ${maybeFlag(trustedArg`--all`, opts.all)}
222 ${maybeFlag(trustedArg`--filter`, opts.filter)}
223 ${maybeFlag(trustedArg`--format`, opts.format)}`,
224 )
225 ).stdout.trim()
226 if (!stdout) return []
227
228 return stdout.split('\n')
229 }
230
231 async doesImageExist(imageName: string): Promise<boolean> {
232 if (this.config.DOCKER_BUILD_OUTPUT === 'load') {

Callers 1

Calls 4

runDockerCommandMethod · 0.95
cmdFunction · 0.90
maybeFlagFunction · 0.90
trustedArgFunction · 0.90

Tested by

no test coverage detected