lib/docker.js
function tryBindPath(serverless, bindPath, testFile) {
  const options = [
    'run',
    '--rm',
    '-v',
    `${bindPath}:/test`,
    'alpine',
    'ls',
    `/test/${testFile}`
  ];
  try {
    const ps = dockerCommand(options);
    if (process.env.SLS_DEBUG) {
      serverless.cli.log(`Trying bindPath ${bindPath} (${options})`);
      serverless.cli.log(ps.stdout.trim());
    }
    return ps.stdout.trim() === `/test/${testFile}`;
  } catch (err) {
    return false;
  }
}
function tryBindPath(serverless, bindPath, testFile) {
  const options = [
    'run',
    '--rm',
    '-v',
    `${bindPath}:/test`,
    'alpine',
    'ls',
    `/test/${testFile}`
  ];
  try {
    const ps = dockerCommand(options);
    if (process.env.SLS_DEBUG) {
      serverless.cli.log(`Trying bindPath ${bindPath} (${options})`);
      serverless.cli.log(ps.stdout.trim());
    }
    return ps.stdout.trim() === `/test/${testFile}`;
  } catch (err) {
    return false;
  }
}
function tryBindPath ( serverless , bindPath , testFile ) { const options = [ 'run' , '--rm' , '-v' , ` ${ bindPath } ` , 'alpine' , 'ls' , ` ${ testFile } ` ] ; try { const ps = dockerCommand ( options ) ; if ( process . env . SLS_DEBUG ) { serverless . cli . log ( ` ${ bindPath } ${ options } ` ) ; serverless . cli . log ( ps . stdout . trim ( ) ) ; } return ps . stdout . trim ( ) === ` ${ testFile } ` ; } catch ( err ) { return false ; } }
Test bind path to make sure it's working
@param {string} bindPath
@return {boolean}
Test bind path to make sure it s working