当前位置:   article > 正文

win10家庭版安装docker_docker is configured to use the default machine wi

docker is configured to use the default machine with ip

详细的安装可以参考如下两个博客:
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:

  1. 拉取镜像splash
    执行命令:$ docker pull scrapinghub/splash
  2. $ docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash
    2019-09-15 01:53:03+0000 [-] Log opened.
    2019-09-15 01:53:03.237474 [-] Splash version: 3.3.1
    2019-09-15 01:53:03.242515 [-] Qt 5.9.1, PyQt 5.9.2, WebKit 602.1, sip 4.19.4, Twisted 18.9.0, Lua 5.2
    2019-09-15 01:53:03.242959 [-] Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609]
    2019-09-15 01:53:03.243376 [-] Open files limit: 1048576
    2019-09-15 01:53:03.243615 [-] Can’t bump open files limit
    2019-09-15 01:53:03.350639 [-] Xvfb is started: [‘Xvfb’, ‘:1453629045’, ‘-screen’, ‘0’, ‘1024x768x24’, ‘-nolisten’, ‘tcp’]
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
    2019-09-15 01:53:03.667237 [-] proxy profiles support is enabled, proxy profiles path: /etc/splash/proxy-profiles
    2019-09-15 01:53:03.667745 [-] memory cache: enabled, private mode: enabled, js cross-domain access: disabled
    2019-09-15 01:53:03.865126 [-] verbosity=1, slots=20, argument_cache_max_entries=500, max-timeout=90.0
    2019-09-15 01:53:03.867063 [-] Web UI: enabled, Lua: enabled (sandbox: enabled)
    2019-09-15 01:53:03.868234 [-] Site starting on 8050
    2019-09-15 01:53:03.868655 [-] Starting factory <twisted.web.server.Site object at 0x7f364703ecc0>
    2019-09-15 01:53:03.869333 [-] Server listening on http://0.0.0.0:8050
    注意,现在已经启动了8050端口服务,但是需要用http://192.168.99.100:8050访问浏览器

如果再次启动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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/827305
推荐阅读
相关标签
  

闽ICP备14008679号