Skip to content

Commit c5d9315

Browse files
Paul Vecchiodschep
Paul Vecchio
authored andcommitted
fix broken windows path (serverless#247)
Current version seems to handle windows paths improperly ``` sh docker: Error response from daemon: Mount denied: The source path "C\\:/Users/Paul/Development/solidangle/match-api/app/.serverless/requirements\\:/var/task\\" is not a valid Windows path. See 'docker run --help'. ``` Calling `dockerPathForWin` on `bindPath` creation resolves issue.
1 parent 5dd691d commit c5d9315

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/pip.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@ function installRequirements(targetFolder, serverless, options) {
147147
serverless.cli.log(`Docker Image: ${dockerImage}`);
148148

149149
// Prepare bind path depending on os platform
150-
const bindPath = getBindPath(serverless, targetFolder);
150+
const bindPath = dockerPathForWin(
151+
options,
152+
getBindPath(serverless, targetFolder)
153+
);
151154

152-
cmdOptions = ['run', '--rm', '-v', quote_single(`${bindPath}:/var/task:z`)];
155+
cmdOptions = ['run', '--rm', '-v', `${bindPath}:/var/task:z`];
153156
if (options.dockerSsh) {
154157
// Mount necessary ssh files to work with private repos
155158
cmdOptions.push(

0 commit comments

Comments
 (0)