赞
踩
详细的安装可以参考如下两个博客:
https://blog.csdn.net/tina_ttl/article/details/51372604
https://blog.csdn.net/hao_kkkkk/article/details/79853752
安装过程会一直卡在下载boot2docker.iso,最好手动下载,然后把下载文件放到C:\Users\Administrator.docker\machine\cache目录下:
Running pre-create checks…
(default) No default Boot2Docker ISO found locally, downloading the latest release…
(default) Latest release for github.com/boot2docker/boot2docker is v18.09.9
(default) Downloading C:\Users\Administrator.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.9/boot2docker.iso…
安装完成后:
会提示虚拟ip地址,后续所有的操作都是基于该ip地址进行的:
docker is configured to use the default machine with IP 192.168.99.100
解决方式:
需要到https://github.com/boot2docker/boot2docker/releases下载最新的,
并复制到C:\Users\Administrator.docker\machine\cache目录下
可参考:https://blog.csdn.net/rickyit/article/details/72772552
基于docker安装splash:
如果再次启动docker run -p 8050:8050 scrapinghub/splash,
如果没有像前面配置加速器的话,这里会报超时。
如果报port allocated端口占用,就docker ps 查看正使用的镜像,docker kill -s kill id,把这个镜像杀死,重启即可。
docker-machine ip myjupytermachine
Docker machine “myjupytermachine” does not exist. Use “docker-machine ls” to list machines. Use “docker-machine create” to add a new one.
如何创建启动docker machine
docker-machine create myjupytermachine
docker-machine ip myjupytermachine
如何卸载Docker Machine
要单独删除每台机器: docker-machine rm
注:默认的用户名和密码是: docker/tcuser
安装完成后,就可以通过谷歌浏览器访问:http://192.168.99.100:8050 ,不清楚为什么,通过ie浏览器无法访问。 参考下图,可以通过lua语言编写脚本,然后点击Render me:
下面是两个lua 测试脚本,大家可以拷贝运行一下:
function main(splash, args) assert(splash:go(args.url)) assert(splash:wait(0.5)) return { html = splash:html(), title = splash:evaljs("document.title") } end function main(splash, args) local example_urls = {"www.baidu.com","www.taobao.com","www.zhihu.com"} local urls = args.urls or example_urls local results = {} for index, url in ipairs(urls) do local ok, reason = splash:go("http://" .. url) if ok then splash:wait(2) results[url] = splash:png() end end return results end
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。