diff --git a/index.js b/index.js index aadad43b..9c5bf401 100644 --- a/index.js +++ b/index.js @@ -68,6 +68,9 @@ class ServerlessPythonRequirements { if (options.dockerizePip === 'non-linux') { options.dockerizePip = process.platform !== 'linux'; } + if (options.dockerizePip && process.platform === 'win32') { + options.pythonBin = 'python'; + } if ( !options.dockerizePip && (options.dockerSsh || options.dockerImage || options.dockerFile) diff --git a/lib/docker.js b/lib/docker.js index db2e81b5..e38d653c 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -10,7 +10,10 @@ const path = require('path'); */ function dockerCommand(options) { const cmd = 'docker'; - const ps = spawnSync(cmd, options, { encoding: 'utf-8' }); + const ps = spawnSync(cmd, options, { + encoding: 'utf-8', + windowsVerbatimArguments: true + }); if (ps.error) { if (ps.error.code === 'ENOENT') { throw new Error('docker not found! Please install it.'); @@ -134,7 +137,7 @@ function getBindPath(serverless, servicePath) { for (let i = 0; i < bindPaths.length; i++) { const bindPath = bindPaths[i]; - if (tryBindPath(serverless, bindPath, testFile)) { + if (tryBindPath(serverless, `"${bindPath}"`, testFile)) { return bindPath; } }