* Helper function to run a docker command * @param {string[]} options * @return {Object}
(options, pluginInstance)
| 11 | * @return {Object} |
| 12 | */ |
| 13 | async 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…