简体   繁体   中英

Windows 10 Docker Sitespeed.io error: "$(pwd)" includes invalid characters for a local volume name

I am very new to docker so this may be a simple fix.

I am trying to get an instance of sitespeed.io up and running by following their docs on a Windows 10 machine which has a default install of Docker - not using Windows containers, C is shared.. Install steps: https://www.sitespeed.io/documentation/sitespeed.io/installation/#windows-1

Step 1 works fine.

  • C:\\Users\\Vicky> docker pull sitespeedio/sitespeed.io

Step 2 does not.

  • C:\\Users\\Vicky> docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox

This results in an error that I am looking for help with. Specifically:

C:\WINDOWS\system32>docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox
docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.

So running the command as per suggestion from Tarun: https://stackoverflow.com/users/2830850/tarun-lalwani works.

docker run --rm -v "%cd%":/sitespeed.io sitespeedio/sitespeed.io http: //www.yahoo.com -b firefox (Space added to URL so you can see the full string.)

Now it produces the following error...

docker run --rm -v "%cd%":/sitespeed.io sitespeedio/sitespeed.io https://www.yahoo.com -b firefox
Google Chrome 60.0.3112.78
Mozilla Firefox 54.0
[2017-09-13 22:58:56] INFO: Versions OS: linux 4.9.41-moby nodejs: v6.11.1 sitespeed.io: 5.5.0 browsertime: 1.6.1 coach: 0.36.0
[2017-09-13 22:58:57] INFO: Starting firefox for analysing https://www.yahoo.com 3 time(s)
[2017-09-13 22:58:57] Testing url https://www.yahoo.com run 1
[2017-09-13 22:59:39] Catched a WebDriverError [Reached error page: about:neterror?e=dnsNotFound&u=https%3A//www.yahoo.com/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20find%20the%20server%20at%20www.yahoo.com.]. Try one more time.WebDriverError: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//www.yahoo.com/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20find%20the%20server%20at%20www.yahoo.com.
[2017-09-13 23:00:20] WebDriverError:WebDriverError: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//www.yahoo.com/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20find%20the%20server%20at%20www.yahoo.com.
[2017-09-13 23:00:20] Could not load URLUrlLoadError: Failed to load https://www.yahoo.com, cause: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//www.yahoo.com/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20find%20the%20server%20at%20www.yahoo.com.
[2017-09-13 23:00:21] ERROR: https://www.yahoo.com generated the following error in Browsertime UrlLoadError: Failed to load https://www.yahoo.com
    at BrowsertimeError (/usr/src/app/node_modules/browsertime/lib/support/errors.js:5:5)
    at UrlLoadError (/usr/src/app/node_modules/browsertime/lib/support/errors.js:19:5)
    at getUrl.then.then.catch.catch.e (/usr/src/app/node_modules/browsertime/lib/core/seleniumRunner.js:175:15)
From previous event:
    at SeleniumRunner.loadAndWait (/usr/src/app/node_modules/browsertime/lib/core/seleniumRunner.js:173:13)
    at Promise.resolve.tap.tap.tap.tap.tap (/usr/src/app/node_modules/browsertime/lib/core/engine.js:281:27)
From previous event:
    at runIteration (/usr/src/app/node_modules/browsertime/lib/core/engine.js:281:10)
    at Promise.reduce (/usr/src/app/node_modules/browsertime/lib/core/engine.js:357:27)
From previous event:
    at Promise.resolve.tap.tap.tap.tap.result (/usr/src/app/node_modules/browsertime/lib/core/engine.js:354:17)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Engine.run (/usr/src/app/node_modules/browsertime/lib/core/engine.js:353:8)
    at engine.start.then (/usr/src/app/lib/plugins/browsertime/analyzer.js:95:26)
From previous event:
    at Object.analyzeUrl (/usr/src/app/lib/plugins/browsertime/analyzer.js:95:8)
    at storageManager.createDirForUrl.then.then (/usr/src/app/lib/plugins/browsertime/index.js:179:32)
    at /usr/src/app/node_modules/mkdirp/index.js:30:20
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at Object.processMessage (/usr/src/app/lib/plugins/browsertime/index.js:179:12)
    at queue.process.message (/usr/src/app/lib/support/queueHandler.js:183:32)
    at drainItem (/usr/src/app/node_modules/concurrent-queue/index.js:92:21)
    at Immediate.drain (/usr/src/app/node_modules/concurrent-queue/index.js:73:84)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
[2017-09-13 23:00:21] ERROR: TypeError: Cannot read property 'getItems' of undefined
    at Object.summarize (/usr/src/app/lib/plugins/assets/aggregator.js:103:49)
    at Object.processMessage (/usr/src/app/lib/plugins/assets/index.js:40:36)
    at queue.process.message (/usr/src/app/lib/support/queueHandler.js:183:32)
    at drainItem (/usr/src/app/node_modules/concurrent-queue/index.js:92:21)
    at Immediate.drain (/usr/src/app/node_modules/concurrent-queue/index.js:73:84)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
[2017-09-13 23:00:21] INFO: Render HTML for 1 page(s)
[2017-09-13 23:00:21] INFO: HTML stored in /sitespeed.io/sitespeed-result/www.yahoo.com/2017-09-13-22-58-56
[2017-09-13 23:00:21] INFO: Finished analysing https://www.yahoo.com

Try use "." instead which means to use the current directory. The updated example then looks like:

docker run --rm -v .:/sitespeed.io sitespeedio/sitespeed.io https://www.yahoo.com -b firefox

It is because in your present working directory the command is unable to find the folder "sitespeed.io". Run the command like below:

docker run --rm -v "$(pwd)" sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox

And if you are using a windows machine, try doing the below

docker run --rm -v "${pwd}":/sitespeed.io sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox

Please try below :

C:\\Users\\Vicky> docker run --shm-size=1g --rm -v "$(pwd)":/Users/Vicky sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox

You need to provide the present working directory path in place of sitespeed.io

C:\\Users\\Vicky> docker run --shm-size=1g --rm -v "$(pwd)":/Users/Vicky sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM