MCPcopy Index your code
hub / github.com/serverless/serverless / dockerCommand

Function dockerCommand

packages/serverless/lib/plugins/python/lib/docker.js:13–30  ·  view source on GitHub ↗

* Helper function to run a docker command * @param {string[]} options * @return {Object}

(options, pluginInstance)

Source from the content-addressed store, hash-verified

11 * @return {Object}
12 */
13async function dockerCommand(options, pluginInstance) {
14 const cmd = 'docker'
15 try {
16 return await spawn(cmd, options, { encoding: 'utf-8' })
17 } catch (e) {
18 if (
19 e.stderrBuffer &&
20 e.stderrBuffer.toString().includes('command not found')
21 ) {
22 throw new ServerlessError(
23 'docker not found! Please install it.',
24 'PYTHON_REQUIREMENTS_DOCKER_NOT_FOUND',
25 { stack: false },
26 )
27 }
28 throw e
29 }
30}
31
32/**
33 * Build the custom Docker image

Callers 4

buildImageFunction · 0.85
tryBindPathFunction · 0.85
getBindPathFunction · 0.85
getDockerUidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…